====== Building A Package ====== This is a rough outline for building Slackware packages. Some steps may not be neccessary, some steps might be missing. Use the discussion page for side-notes such as using [[http://www.slackware.com/~mozes|slacktrack]] (when DESTDIR fails) and other utilities like checkinstall. ====== The good and decent way ====== Configure and compile the source as you usually do: ./configure --prefix=/usr --libdir=/usr/lib64 --localstatedir=/var --sysconfdir=/etc make For 32bit systems, adjust the library directory location: --libdir=/usr/lib Make a temporary destination directory available: mkdir /tmp/build Install into the temporary directory: make install DESTDIR=/tmp/build Now strip libs/bins within the temporary directory: strip -s /tmp/build/usr/lib/* /tmp/build/usr/bin/* You also want to make sure that anything in /usr/man is gzipped before you make the package: gzip -9 /tmp/build/usr/man/man?/*.? Create the install directory, this is where the description and install script will be stored: cd /tmp/build mkdir install cd install One-liner (for the copy & paste people): cd /tmp/build; mkdir install; cd install Using a text editor (or a [[http://slack-desc.sourceforge.net|tool]]), create a file called [[slack-desc]] and fill it with the following contents: |-----handy-ruler------------------------------------------------------| appname: appname (Short description of the application) appname: appname: Description of application - this description should be fairly appname: in-depth; in other words, make it clear what the package does (and appname: maybe include relevant links and/or instructions if there's room), appname: but don't get too verbose. appname: This file can have a maximum of eleven (11) lines of text preceded by appname: the "appname: " designation. appname: appname: It's a good idea to include a link to the application's homepage too. appname: The "appname" string must *exactly* match the application name portion of the Slackware package (for example, a package titled "gaim-1.5-i486-1.txz" must have a slack-desc file with the string of "gaim: " rather than "Gaim: " or "GAIM: " or something else. The first line must show the application name followed by a short description (enclosed in parentheses). Create the actual package: cd /tmp/build makepkg ../app-version-arch-tag.txz //(The dashes should appear as above, so if the version has a subversion like say "1.0 RC2" make sure you use 1.0_RC2 not 1.0-RC2. The arch should be something like "i486" for example. The tag should consist of the build number and your initals, e.g. 1zb for Zaphod Beeblebrox's first build, 2zb for his second build, etc. Official slackware packages have only numbers as tags.)// When prompted to recreate symbolic links, say yes
When prompted to reset permissions, say no //Note: Using **makepkg -l y -c n** will give you the same behaviour as answering yes to the symlinks question, and no to the permissions question.// If all went well, you can now install the package. cd .. installpkg app-version-arch-tag.txz ====== Specific tweaks ===== **Perl info**: perl packages comes with /usr/lib64/perl5/perllocal.pod and you probably don't want to overwrite the local version. Instead you could move the file to your package root/tmp and use the doinst.sh to append the new information to the old with something like ( cat /tmp/perllocal.pod >> /usr/lib64/perl5/perllocal.pod ). ====== The "I don't have time" way ====== Fortunately, Slackware are pretty flexible too. If you don't mind much about what is the source (beware!) that you're compiling you can burn some stages and do something like this: ./configure --prefix=/usr make install DESTDIR=$(pwd)/PACKAGE cd $(pwd)/PACKAGE makepkg -l y -c n ../app-version-arch-tag.txz installpkg ../app-version-arch-tag.txz Of course, you will have a package without description, (probably) uncompressed man pages and unstripped binaries. ====== Sources ====== * Original source: [[http://www.slackwiki.com/Building_A_Package]] \\ * Contributions by [[wiki:user:arfon | arfon]] \\ {{tag>howtos software makepkg package_management author_slackwiki}}