This is a discussion on Making own packages - what's good practice? within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> I'm going to be making my own packages for slack to use on my own servers. I am currently ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I'm going to be making my own packages for slack to use on my own servers. I am currently doing this using RPM on Rh machines, but if I'm changing distribution, may as well change all the way. The doco's a bit light on... I understand that all I get is a tarball and an install file, but there are presumably right ways and wrong ways of doing the install file? What are good packages to look at to see good practice in building install files? What should a good install file do, what should it definitely not do? Where do changelogs normally live in the file tree? Is there any way of querying changelogs except having them in a file in the file tree and looking at them? Are install files normally backed up somewhere so you can come along later and look at a package and say "so that's what it does" rather than having to untar a copy somwhere? can you see what installed packages did when they were installed? What about removing? There doesn't seem to be an uninstall file that can be run? have I been spoiled by RPM and if I want that much control and information I should stick to RPMs? Zebee |
| |||
| Zebee Johnstone wrote: > The doco's a bit light on... I understand that all I get is a tarball > and an install file, but there are presumably right ways and wrong ways > of doing the install file? here are couple of ways packages can be built a) makepkg, good source of examples would be slackware source b) checkinstall/slackpkg, they let you automate the creation of packages. in 90% or more cases, checkinstall is good enough. > What are good packages to look at to see good practice in building > install files? look at pat's slackbuild scripts, available on any slackware mirror, under source/ dir > What should a good install file do, what should it definitely not do? they should do their job of adjusting whatever you feel that needs to be adjusted. > Where do changelogs normally live in the file tree? nowhere, really. that's not required for your package at all. > Is there any way of querying changelogs except having them in a file in > the file tree and looking at them? not with slackware packaging system. > Are install files normally backed up somewhere so you can come along > later and look at a package and say "so that's what it does" rather than > having to untar a copy somwhere? nope > can you see what installed packages > did when they were installed? nope > What about removing? There doesn't seem to be an uninstall file that > can be run? removepkg <package name> > have I been spoiled by RPM and if I want that much control and > information I should stick to RPMs? most likely yes. although from my experience of managing plenty of slackware machines, i never needed such detailed information nor control. installpkg/removepkg/upgradepkg suffice for me. |
| |||
| -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 In alt.os.linux.slackware, Zebee Johnstone dared to utter, > The doco's a bit light on... I understand that all I get is a tarball > and an install file, but there are presumably right ways and wrong ways > of doing the install file? ../configure make make install DESTDIR=/tmp/build cp $VARIOUS_DOCS /tmp/build/usr/doc cd /tmp/build makepkg /tmp/$PACKAGE > What are good packages to look at to see good practice in building > install files? The SlackBuild scripts on the source code cds. - -- It is better to hear the rebuke of the wise, Than for a man to hear the song of fools. Ecclesiastes 7:5 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFBGZoZlKR45I6cfKARArc2AKCGMBavUk5Zs68kleDyKT HxrMBbMwCgrlSv HeckI1g1rt+ey8GY+aU6K8w= =YuPT -----END PGP SIGNATURE----- |
| |||
| In alt.os.linux.slackware on Tue, 10 Aug 2004 23:13:23 -0400 Dominik L.. Borkowski <dom@vbi.vt.edu> wrote: > Zebee Johnstone wrote: > here are couple of ways packages can be built > > a) makepkg, good source of examples would be slackware source > b) checkinstall/slackpkg, they let you automate the creation of packages. in > 90% or more cases, checkinstall is good enough. I am building specific machines, I require things like crontab updating to my specs. I suspect that neither of these do more than config and makefile? > >> Where do changelogs normally live in the file tree? > > nowhere, really. that's not required for your package at all. No, but it's very useful for system maintenance, especially if you are packaging config files. > >> What about removing? There doesn't seem to be an uninstall file that >> can be run? > > removepkg <package name> Which does what? And can it do things like remove crontab lines? Or run an uninstaller that does? > >> have I been spoiled by RPM and if I want that much control and >> information I should stick to RPMs? > > most likely yes. although from my experience of managing plenty of slackware > machines, i never needed such detailed information nor control. > installpkg/removepkg/upgradepkg suffice for me. I do configs so that machines are utterly identical, but customised when needful. and can be instantly rebuilt. Machines in different countries. I have been doing things like name server zone files and apache virtual server files via RPM. Different versions of perl modules depending on various things, different configs for mail, things like that. The RPM install scripts work out which machine they are being installed on, and do the right thing. and when uninstalled, they clean up after themselves. That's important to me. Tight control is essential when you are using your packages to configure your machines. Zebee -- SAGE-AU: The System Administrator's Guild. www.sage-au.org.au To advance the profession of System Administration by raising awareness of the need for System Administrators, and educating System Administrators in technical as well as professional issues. |
| |||
| Zebee Johnstone wrote: > I am building specific machines, I require things like crontab updating > to my specs. I suspect that neither of these do more than config and > makefile? neither of them have anything to do with config nor makefile [i assume you're talking about ./configure script]. > No, but it's very useful for system maintenance, especially if you are > packaging config files. i should have been more specific: it's not required to be present in slackware packages for them to be valid packages, and there is no default place. a lot of software will have changelogs in /usr/doc/<software name>. >> removepkg <package name> > Which does what? out of curiosity, have you ran slackware yet? the reason why i'm asking is i'd like to know if i'm asked to recite back the man page for removepkg, or elaborate more on my experience. > And can it do things like remove crontab lines? nope > Or run an uninstaller that does? nope > The RPM install scripts work out which machine they are being > installed on, and do the right thing. > and when uninstalled, they clean up after themselves. That's important > to me. then maybe you should consider sticking to an rpm based distribution. what made you want to switch to slackware? |
| |||
| In alt.os.linux.slackware on Wed, 11 Aug 2004 00:10:16 -0400 Dominik L.. Borkowski <dom@vbi.vt.edu> wrote: > Zebee Johnstone wrote: >> to my specs. I suspect that neither of these do more than config and >> makefile? > > neither of them have anything to do with config nor makefile [i assume > you're talking about ./configure script]. BUt they don't do more than that from what I could tell looking at them. They make the basic slack package, but how do they handle wanting to do more than "install file here"? > i should have been more specific: it's not required to be present in > slackware packages for them to be valid packages, and there is no default > place. a lot of software will have changelogs in /usr/doc/<software name>. That's what I was after. I figure if I'm going to write packages, I should do it in the usual way, meaning put things in the usual places. But how to find out what those are? > out of curiosity, have you ran slackware yet? the reason why i'm asking is > i'd like to know if i'm asked to recite back the man page for removepkg, or > elaborate more on my experience. yes, I've installed it, yes I've read the page. The pages aren't written for package writers but package users. So if you can get removepkg to do more than delete the files that were in the package tarball and tell the package manager it has done so, I wouldn't expect the man page to tell you that. any more than the rpm man page tells you how to create rpms. It is of course possible that I haven't realised how primitive the package system is, but thought it must have changed a little since I last installed slack back in 1996. For example... if your install file moves a config file to a backup name, and puts its own file there instead, can removepkg replace that new file with the backup one? If you have a file /usr/local/etc/fred.newconf and your install script copies /usr/local/etc/fred.conf to /usr/local/etc/fred.conf,bak and then /usr/local/etc/fred.newconf to /usr/local/etc/fred.conf, what does removepkg do when invoked? I assume it will attempt to remove /usr/local/etc/fred.newconf, and you can't tell it to do anything else. If your install script inserts a line into crontab, then how is that removed? What do people do if they want to set up a bunch of machines, do them all by hand? Use gnuconf? Some other system? > > then maybe you should consider sticking to an rpm based distribution. what > made you want to switch to slackware? Because I want something that keeps fairly up to date but I can install my own builds and config files for things I wish to be at certain release versions or compiled in certain ways like MySQL or Apache, that can be installed as server only with the minimum of GUI setup, that isn't "release early release often" as Fedora is but stable, that isn't as complex and boggling as Debian, and isn't as costly as RHEL. Slack seems to do what I want nicely except for the minimal installer which doesn't lend itself to good control of multiple server machine configs. I don't wnat to have to go to gnuconf for various other reasons, and doing things in RPM works well for me. I don't want to run a mixed rpm and pkg system because that way lies dependency hell. Zebee |
| |||
| Zebee Johnstone wrote: > Are install files normally backed up somewhere so you can come along > later and look at a package and say "so that's what it does" rather than > having to untar a copy somwhere?**can*you*see*what*installed*packages > did when they were installed? I'm confused about some of the other answers you've been getting to this question. It seems to me you are looking for the /var/log/scripts directory, and after reading through a few of the scripts, I don't see any glaring reason why they couldn't include things like hostname checking, conditionals, and crontab entries. They are just bash scripts, after all. Jeffrey |
| |||
| In alt.os.linux.slackware on 10 Aug 2004 23:03:06 -0500 +Alan Hicks+ <alan@lizella.netWORK> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > In alt.os.linux.slackware, Zebee Johnstone dared to utter, >> The doco's a bit light on... I understand that all I get is a tarball >> and an install file, but there are presumably right ways and wrong ways >> of doing the install file? > > ./configure > make > make install DESTDIR=/tmp/build > cp $VARIOUS_DOCS /tmp/build/usr/doc > cd /tmp/build > makepkg /tmp/$PACKAGE So no one ever does anything in the install scripts such as back up config files? And all packages are installed in whatever dirs configure thinks is a good thing? I didn't want to find myself overwriting or being overwritten, or not installing things I should be, or not checking dependencies, but it appears there's nothing that sophisticated available? I wasn't expecting anything as boggling as the debian docs, but I was expecting a bit more about good practice in writing and setting configs for example. Zebee |
| |||
| Zebee Johnstone wrote: > BUt they don't do more than that from what I could tell looking at them. > They make the basic slack package, but how do they handle wanting to do > more than "install file here"? well, maybe you should start from a basic overview of the slackware package. you have the following components in a simple gzipped tarball: a) files and directories, with specific permissions b) the above include three special items: - /install directory - /install/doinst.sh script, which can be anything - /install/slack-desc, which is a small text file that has a description of the package. that's it. nothing more to a slackware package. whatever else you want, is not part of the slackware package system. > That's what I was after. I figure if I'm going to write packages, I > should do it in the usual way, meaning put things in the usual places. > But how to find out what those are? by looking around slackware. install slackware, and look around. you have /etc/rc.d dir for startup scripts, /usr/doc for documentation, etc. your question is a bit too vague to be answered in detail. > yes, I've installed it, yes I've read the page. The pages aren't > written for package writers but package users. So if you can get > removepkg to do more than delete the files that were in the package > tarball and tell the package manager it has done so, I wouldn't expect > the man page to tell you that. any more than the rpm man page tells you > how to create rpms. actually, the problem is that you think that slackware package manager and package system is capable of doing more. the truth is, it's much more primitive than what rpm is. that's why you're not finding it in the man page. > It is of course possible that I haven't realised how primitive the > package system is, but thought it must have changed a little since I > last installed slack back in 1996. nope, it hasn't changed much, besides adding couple small switches here and there, and using long filenames. > For example... if your install file moves a config file to a backup > name, and puts its own file there instead, can removepkg replace that > new file with the backup one? nope. > If you have a file /usr/local/etc/fred.newconf and your install script > copies /usr/local/etc/fred.conf to /usr/local/etc/fred.conf,bak and then > /usr/local/etc/fred.newconf to /usr/local/etc/fred.conf, what does > removepkg do when invoked? I assume it will attempt to remove > /usr/local/etc/fred.newconf, and you can't tell it to do anything else. correct > If your install script inserts a line into crontab, then how is that > removed? What do people do if they want to set up a bunch of machines, > do them all by hand? Use gnuconf? Some other system? they do it by hand, by series of elaborate scripts, or by using other distributions. > Because I want something that keeps fairly up to date but I can install > my own builds and config files for things I wish to be at certain > release versions or compiled in certain ways like MySQL or Apache, that > can be installed as server only with the minimum of GUI setup, that > isn't "release early release often" as Fedora is but stable, that isn't > as complex and boggling as Debian, and isn't as costly as RHEL. > Slack seems to do what I want nicely except for the minimal installer > which doesn't lend itself to good control of multiple server machine > configs. I don't wnat to have to go to gnuconf for various other > reasons, and doing things in RPM works well for me. > > I don't want to run a mixed rpm and pkg system because that way lies > dependency hell. sorry to say that, but i think you're looking for something that doesn't really exist. the pros of slackware, which are simplicity, are not met with your requirements for a sophisticated package system. that's the problem, you're expecting a bit too much i think. yes, it would be nice to have a solution to this, but i'm afraid slackware may not be an answer to your needs. your best bet right now is to experiment with slackware. install it. trash it. see how removepkg [try -warn option] behaves, how upgradepkg acts, etc. it may be what you want, it also may be less than you expected. as with every solution, there are tradeoffs. either way, good luck. [btw, looks like i forgot about /var/log/scripts, it's been awhile since i've actually looked there] |
| ||||
| In alt.os.linux.slackware on Tue, 10 Aug 2004 22:04:40 -0700 Jeffrey Froman <jeffrey@I.slack> wrote: > > I'm confused about some of the other answers you've been getting to this > question. It seems to me you are looking for the /var/log/scripts > directory, and after reading through a few of the scripts, I don't see any > glaring reason why they couldn't include things like hostname checking, > conditionals, and crontab entries. They are just bash scripts, after all. aha! That sounds like it, RPM just uses shell scripts too. What reads /var/log/scripts and when? Or is that where old /install scripts go when finished with? Zebee |