$Id: rpmbuild.txt 14732 2012-05-08 16:06:02Z sloot $ $URL: https://ilk.uvt.nl/svn/trunk/doc/build-instructions-for-software-packages/rpmbuild.txt $ Introduction ============ This documents describes how to create Fedora RPM packages from the software produced at ILK/TiCC, Tilburg University. It describes procedures appicable for the TiMBL, Mbt, Dimbl and Frog software, a.o. This document is mainly useful for ILK/TiCC software developers. This document is still in DRAFT status. A possibly up to date copy might be available from http://ilk.uvt.nl/software-packages/rpmbuild.txt . See also https://svn.ilk.uvt.nl/svn/trunk/sources/Timbl-pkg/rpm/log . (FIXME: merge that one) Creating an convenient build environment. ---------------------------------------- On a Fedora system, create a directory 'rpmbuild' with subdirs SOURCES and... $ mkdir rpmbuild $ mkdir rpmbuild/SOURCES Get the .spec files into a SPECS subdir: $ cd rpmbuild $ svn co https://ilk.uvt.nl/svn/trunk/sources/Timbl-pkg/rpm SPECS Building {,src}rpm from spec and .tar.gz ---------------------------------------- We take 'ucto' as an example Adapt the .spec file to reflect the new situation: Version number, additional files, etc. $ cd SPECS $ vi ucto.spec $ svn commit -m 'new upstream' ucto.spec Now get the desired version from our download site: Suppose we are building 0.5.0 now. $ cd ../SOURCES $ wget http://software.ticc.uvt.nl/ucto-0.5.0.tar.gz Now build: $ cd ../SPECS $ rpmbuild -ba ucto.spec This wil (hopefully) build an binary .rpm into rpmbuilds/RPMS/, were is i386 or x_86_64. A source rpm wil be build in rpmbuilds/SRPMS. Suppose we were building om X86_64. Try to upgrade the package: as root: $ rpm -U ../RPMS/x86_64/ucto-0.5.0-1.x86_64.rpm or, if you have 'sudo' rights: $ sudo rpm -U ../RPMS/x86_64/ucto-0.5.0-1.x86_64.rpm See what is installed: $ rpm -q -l ucto Does it work? $ ucto -V Ucto - Unicode Tokenizer - version 0.5.0 (c) ILK 2009 - 2012, Induction of Linguistic Knowledge Research Group, Tilburg University Licensed under the GNU General Public License v3 based on [libfolia 0.5] YES! Making the RPM's avaliable on phanes: ----------------------------------- I assume we are building for fedora 16 here. upload the rpms to phanes: $ cd rpmbuild/SRPMS $ scp ucto-0.5.0-1.src.rpm phanes:/var/www/rpm.ticc.uvt.nl/fedora-core-16-yum-rpm/SRPMS/ $ cd ../RPMS/x86_64 $ scp ucto-0.5.0-1.x86_64.rpm phanes:/var/www/rpm.ticc.uvt.nl/fedora-core-16-yum-rpm/16/RPMS/x86_64/ op phanes: $ cd /var/www/rpm.ticc.uvt.nl/fedora-core-16-yum-rpm $ createrepo --update `pwd` (add -v for more verbose processing) 51/51 * 14/RPMS/x86_64/mbtserver-0.1-1.fc14.x86_64.rpm Saving Primary metadata Saving file lists metadata Saving other metadata Done! Constructing a yum repo ----------------------- joostvb@fedora.mdcc.cx:~% cat /etc/fedora-release Fedora release 14 (Laughlin) joostvb@fedora.mdcc.cx:~% rpm -q createrepo le paquetage createrepo n'est pas installé root@fedora.mdcc.cx:~# yum install createrepo ================================================================================ Paquet Architecture Version Dépôt Taille ================================================================================ Installation: createrepo noarch 0.9.8-5.fc14 fedora 81 k Installation pour dépendance: deltarpm x86_64 3.6-0.2.20100708git.fc14 fedora 74 k libxml2-python x86_64 2.7.7-2.fc14 fedora 316 k python-deltarpm x86_64 3.6-0.2.20100708git.fc14 fedora 28 k Résumé de la transaction ================================================================================ Install 4 Package(s) Taille totale des téléchargement : 498 k Installed size: 2.4 M Est-ce correct [o/N] : joostvb@fedora.mdcc.cx:~% mkdir repo && cd repo joostvb@fedora.mdcc.cx:~/repo% createrepo `pwd` joostvb@fedora.mdcc.cx:~/repo% find . . ./repodata ./repodata/other.xml.gz ./repodata/primary.xml.gz ./repodata/repomd.xml ./repodata/filelists.xml.gz root@fedora.mdcc.cx:~# vi /etc/yum.repos.d/ticc.repo root@fedora.mdcc.cx:~# cat /etc/yum.repos.d/ticc.repo # http://yum.baseurl.org/wiki/RepoCreate [ticc] name = TiCC Software baseurl = file:///home/joostvb/repo joostvb@fedora.mdcc.cx:~/repo% mkdir -p SRPMS 14/RPMS joostvb@fedora.mdcc.cx:~% cp -a rpmbuild/RPMS/x86_64 repo/14/RPMS joostvb@fedora.mdcc.cx:~% cp -a rpmbuild/SRPMS/* repo/SRPMS joostvb@fedora.mdcc.cx:~/repo% createrepo --update `pwd` joostvb@fedora.mdcc.cx:~/repo/repodata% zgrep location primary.xml.gz joostvb@fedora.mdcc.cx:~% rpm -q mbtserver le paquetage mbtserver n'est pas installé root@fedora.mdcc.cx:~# yum --nogpgcheck install mbtserver Configuration du processus d'installation Résolution des dépendances --> Lancement de la transaction de test ---> Paquet mbtserver.x86_64 0:0.1-1 marqué pour être installé --> Résolution des dépendances terminée Dépendances résolues ================================================================================ Paquet Architecture Version Dépôt Taille ================================================================================ Installation: mbtserver x86_64 0.1-1 ticc 313 k Résumé de la transaction ================================================================================ Install 1 Package(s) Taille totale des téléchargement : 313 k Installed size: 1.0 M Est-ce correct [o/N] : Téléchargement des paquets : Lancement de rpm_check_debug Lancement de la transaction de test Transaction de test réussie Lancement de la transaction Installation : mbtserver-0.1-1.x86_64 1/1 Installé: mbtserver.x86_64 0:0.1-1 Terminé ! joostvb@fedora.mdcc.cx:~% rpm -q mbtserver mbtserver-0.1-1.x86_64 obsolete: joostvb@bruhat:~% ssh fedora tar zc repo | ssh popper "cat > repo.tar.gz" joostvb@popper:~% ssh phanes tar zvx < repo.tar.gz && rm repo.tar.gz repo/SRPMS/mbt-3.2.4-1.src.rpm repo/14/RPMS/x86_64/timbl-6.3.2-1.fc14.x86_64.rpm repo/repodata/repomd.xml joostvb@popper:~% ssh phanes tar zc /var/www/rpm.ticc.uvt.nl/repo > repo12.tar.gz joostvb@bruhat:~% ssh popper cat repo12.tar.gz | ssh fedora tar zvx joostvb@fedora.mdcc.cx:~/repo% createrepo --update `pwd` joostvb@phanes.uvt.nl:/var...ar/www/rpm.ticc.uvt.nl/repo% rm -rf * joostvb@bruhat:~% ssh fedora tar zc repo | ssh popper "cat > repo.tar.gz" joostvb@popper:~% ssh phanes tar zvx < repo.tar.gz && rm repo.tar.gz repo/ joostvb@phanes.uvt.nl:/var...ar/www/rpm.ticc.uvt.nl/repo% mv ~/repo/* . joostvb@phanes.uvt.nl:/var/www/ilk/packages% ln -s repo fedora-core-14-yum-rpm yum repos and gpg signing ------------------------- root@fedora.mdcc.cx:~# yum install mbtserver [...] Le paquet mbtserver-0.1-1.fc14.x86_64.rpm n'est pas signé yum(8) --nogpgcheck Run with GPG signature checking disabled. Configuration Option: gpgcheck yum.conf(5) [repository] OPTIONS The repository section(s) take the following form: gpgcheck Either `1' or `0'. This tells yum whether or not it should perform a GPG signature check on the packages gotten from this repository. repo_gpgcheck Either `1' or `0'. This tells yum whether or not it should perform a GPG signature check on the repodata from this repository. gpgkey A URL pointing to the ASCII-armored GPG key file for the repository. This option is used if yum needs a public key to verify a package and the required key hasn't been imported into the RPM database. If this option is set, yum will automatically import the key from the specified URL. You will be prompted before the key is installed unless the assumeyes option is set. using our yum repo ------------------ root@fedora.mdcc.cx:~# cat /etc/yum.repos.d/ticc.repo [ticc] name = TiCC Software baseurl = http://ilk.uvt.nl/packages/fedora-core-14-yum-rpm root@fedora.mdcc.cx:~# rpm -q timblserver le paquetage timblserver n'est pas installé root@fedora.mdcc.cx:~# yum --nogpgcheck install timblserver ================================================================================ Paquet Architecture Version Dépôt Taille ================================================================================ Installation: timblserver x86_64 1.1-1 ticc 395 k Résumé de la transaction ================================================================================ Install 1 Package(s) Taille totale des téléchargement : 395 k Installed size: 1.4 M Installé: timblserver.x86_64 0:1.1-1 Terminé !