]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blobdiff - filesystem/filesystem.nm
gcc: Update to 4.8.1.
[people/ms/ipfire-3.x.git] / filesystem / filesystem.nm
index cb010b469ffb7f9b848ec8d172c4c1c31958000b..b7966a8c5ac8bc30609c1479b5b9aa4c01d6b94a 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = filesystem
-version    = 001
+version    = 002
 release    = 2
 
 maintainer = Michael Tremer <michael.tremer@ipfire.org>
@@ -24,6 +24,12 @@ end
 sources   =
 
 build
+       # Pakfire supports python scriptlets since
+       # version 0.9.22.
+       requires
+               pakfire-builder >= 0.9.22
+       end
+
        DIR_APP = %{DIR_SRC}
 
        build
@@ -33,28 +39,27 @@ build
        install
                cd %{BUILDROOT}
                mkdir -pv \
-                       bin \
                        boot \
                        dev \
                        etc/pki \
                        etc/skel \
                        etc/sysconfig \
                        home \
-                       lib/modules \
                        media \
                        mnt \
                        opt \
                        proc \
                        root \
                        run/lock \
-                       sbin \
                        srv \
                        sys \
                        tmp \
                        usr/bin \
                        usr/include \
                        usr/lib \
+                       usr/%{lib} \
                        usr/lib/locale \
+                       usr/lib/modules \
                        usr/sbin \
                        usr/share/{aclocal,dict,doc,empty,info,mime-info,misc} \
                        usr/share/man/man{1,2,3,4,5,6,7,8,9,n,1x,2x,3x,4x,5x,6x,7x,8x,9x,0p,1p,3p} \
@@ -70,18 +75,23 @@ build
                        var/empty \
                        var/lib \
                        var/local \
-                       var/lock/subsys \
                        var/log \
                        var/nis \
                        var/preserve \
-                       var/run \
                        var/spool/{mail,lpd} \
                        var/tmp \
                        var/db \
                        var/cache
 
+               ln -snf usr/bin bin
+               ln -snf usr/sbin sbin
+               ln -snf usr/lib lib
+               [ "%{lib}" = "lib" ] || ln -snf usr/%{lib} %{lib}
+
                ln -snf ../var/tmp usr/tmp
                ln -snf spool/mail var/mail
+               ln -snf ../run var/run
+               ln -snf ../run/lock var/lock
 
                # Setting correct permissions.
                chmod 1777 %{BUILDROOT}/{,var/}tmp
@@ -97,6 +107,25 @@ end
 packages
        package %{name}
                prerequires = setup
+
+               # We do not know, if the filesystem package is the first
+               # in the transaction, so we create the symlinks prior to running
+               # the transaction.
+               script pretransin python
+                       if not os.path.exists("/usr"):
+                               os.makedirs("/usr")
+
+                       for dir in ("/lib", "/%{lib}", "/sbin", "/bin"):
+                               usr_dir = "/usr%s" % dir
+
+                               if not os.path.exists(usr_dir):
+                                       os.makedirs(usr_dir)
+
+                               try:
+                                       os.lstat(dir)
+                               except OSError:
+                                       os.symlink(usr_dir[1:], dir)
+               end
        end
 
        # Although this package is not noarch, it does not