02.18.10
rpm packaging.
Если не следовать умным документам, типа
RPM advanced docs
и правильно не именовать rpm пакеты c rc/pre версиями, можно вляпаться в следующее:
# rpm -Uhv –force /usr/src/redhat/RPMS/noarch/postfixadmin-2.3rc7-1.noarch.rpm
Preparing… ########################################### [100%]
1:postfixadmin ########################################### [100%]
# rpm -Uhv /usr/src/redhat/RPMS/noarch/postfixadmin-2.3-3.noarch.rpm
Preparing… ########################################### [100%]
package postfixadmin-2.3rc7-1.noarch (which is newer than postfixadmin-2.3-3.noarch) is already installed
Беда. Пакет то уже в репозитарии и установлен в ряд систем. Тем не менее. Даже с такими кривыми руками можно жить, хотя, конечно, менее комфортно.
Добавляем в spec файл после Version и Release следующую строчку:
Epoch: 1
Пересобираем пакет. И вуаля:
# rpm -Uhv /usr/src/redhat/RPMS/noarch/postfixadmin-2.3-3.noarch.rpm
Preparing… ########################################### [100%]
1:postfixadmin ########################################### [100%]
Do not forget run upgrade.php!
Happy rpm packaging!
Update:
Пожалуй, на всякий случай приведу кусок текста, мало ли со временем та wiki помрет:
“Sometimes, program naming schemes are good, but rpm is lost. For example, with Proftpd, Pre-releases are named with the version followed by the suffix pre and then the pre version number, like so: 1.2.0pre5. Because of string comparisons, rpm thinks that 1.2.0pre5 is newer than 1.2.0 (we know that this is not true).
To permit upgrades to newer packages, we must help rpm to know which packages are newer than others. We could use the Epoch: tag (superseding the Serial: tag) but this is dirty. You have to use another naming convention, putting the “pre” stuff in the release tag; in our example you will call the package “1.2.0-0.pre5.1mdv”. Then, when 1.2.0 comes out, you’ll release “1.2.0-1mdv”, and this package will be able to upgrade the pre5.”