hello on first sorry for my English :) I write something like gentoo's use flags but more simplest. for example i need (or i like :) ) fluxbox witch imlib2 but i don't need xinerama if i wont add or delete some functionality i must rewrite Pkgfile . 3 steps to change it : 1. add to /etc/pkgmk.conf USE="nls imlib" 2. add function to pkgmk if_use() { local TMP_USE=$1 local RET_YES=$2 local RET_NO=$3 for U in $USE do if [ "$U" = "$TMP_USE" ]; then echo $RET_YES return fi done echo $RET_NO } 3. Pkgfile # Description: light windowmanager based on the original blackbox # URL: http://fluxbox.org # Maintainer: # Packager: # Depends on: x11 imlib2 deps="x11 $(if_use imlib2 imlib2) $(if_use xinerama xinerama)" name=fluxbox version=1.0rc2 release=1 source=(http://surfnet.dl.sourceforge.net/sourceforge/fluxbox/fluxbox-$version.tar.g...) build() { cd $SRC/$name-$version ./configure \ --prefix=/usr \ $(if_use nls --enable-nls --disable-nls) \ $(if_use imlib2 --enable-imlib2) \ $(if_use xinerama --enable-xinerama --disable-xinerama) make make install DESTDIR=$PKG } and that's all folks :) if_use <use_flags> <arg_1> <arg_2> if use_flags exist in config then return arg_1 if not then arg_2 simple but powerful :) and in variable deps we have all needed deps What you thinking about it ?
On Tue, Aug 29, 2006 at 05:23:49PM +0200, heidi wrote:
hello on first sorry for my English :)
I write something like gentoo's use flags but more simplest. for example i need (or i like :) ) fluxbox witch imlib2 but i don't need xinerama if i wont add or delete some functionality i must rewrite Pkgfile . [...]
What you thinking about it ?
Personally I think it's ghastly to death. :-) What is CRUX? ISO images? No. Pkgutils? No - they are really not necessary, you can write simple scripts in shell using tar with similar functionality. Pkgfiles? Bingo! Indeed, Pkgfiles is really valuable thing in CRUX. That's it, Pkgfiles should be as KISS as possible. If they are not, then it's not CRUX anymore. Think about the reason why you need USE flags? To customize ports, right? Okay, you can do that in much cleaner way: subversion. You can use attached file, place it in /etc/ports/drivers, chmod +x it, then replace /etc/ports/{core,opt}.rsync with other two attached files. Next, rm -rf /usr/ports/{core,opt} ; ports -u. From that point can change Pkgfiles as you wish, and don't look back for the maintainer preference. Using subversion for the controlling /usr/ports gives you additional benefits (distro upgrading, easy reverting,...) which is offtopic in that thread, but I hope that subversion usage will be fully covered in the public wiki. -- Anton (irc: bd2)
heidi [2006-08-29 17:23]: Hi heidi,
[snip> What you thinking about it ?
IMO USE flags don't fit the often cited KISS principle in CRUX. Most CRUX users choose to hack the Pkgfile if they aren't happy with the existing one. That's what I do, too, and I'm happy with it. In general, please don't cross post to both the general CRUX mailing list and the devel list, thanks. Regards, Tilman -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail?
participants (3)
-
Anton
-
heidi
-
Tilman Sauerbeck