2006-12-19 00:15:54 +01:00
|
|
|
#
|
2011-01-14 14:39:54 +01:00
|
|
|
# spec file for package filesystem
|
2006-12-19 00:15:54 +01:00
|
|
|
#
|
2013-06-17 14:27:16 +02:00
|
|
|
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2006-12-19 00:15:54 +01:00
|
|
|
#
|
2008-08-15 23:48:45 +02:00
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2006-12-19 00:15:54 +01:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2012-03-14 10:17:37 +01:00
|
|
|
|
2006-12-19 00:15:54 +01:00
|
|
|
Name: filesystem
|
2012-01-09 10:16:20 +01:00
|
|
|
Summary: Basic Directory Layout
|
2011-12-06 18:09:23 +01:00
|
|
|
License: GPL-2.0+
|
2006-12-19 00:15:54 +01:00
|
|
|
Group: System/Fhs
|
2012-09-04 15:54:41 +02:00
|
|
|
Version: 12.3
|
2012-01-09 10:16:20 +01:00
|
|
|
Release: 0
|
2006-12-19 00:15:54 +01:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
Obsoletes: aaa_dir
|
|
|
|
Provides: aaa_dir
|
|
|
|
Source: directory.list
|
|
|
|
Source1: filesystem.links
|
|
|
|
Source2: languages
|
2010-09-16 12:20:28 +02:00
|
|
|
Source3: ghost.list
|
2012-09-04 15:54:41 +02:00
|
|
|
Source4: languages.man
|
2006-12-19 00:15:54 +01:00
|
|
|
Source64: directory.list64
|
2007-12-11 00:55:01 +01:00
|
|
|
|
2012-10-06 15:14:58 +02:00
|
|
|
%description
|
|
|
|
This package installs the basic directory structure. It also includes
|
|
|
|
the home directories of system users.
|
|
|
|
|
2006-12-19 00:15:54 +01:00
|
|
|
%prep
|
|
|
|
%setup -c -n filesystem -T
|
|
|
|
|
|
|
|
%install
|
|
|
|
function create_dir () {
|
|
|
|
local MODE=$1
|
2011-07-07 14:07:29 +02:00
|
|
|
case "$MODE" in
|
|
|
|
\#*) return ;;
|
|
|
|
esac
|
2006-12-19 00:15:54 +01:00
|
|
|
local OWNR=$2
|
|
|
|
local GRUP=$3
|
|
|
|
local NAME=$4
|
|
|
|
local XTRA=$5
|
|
|
|
local BDIR=`dirname $NAME`
|
|
|
|
test -d "$RPM_BUILD_ROOT/$NAME" && { echo "dir $NAME does already exist" ; echo "input out of sequence ?" ; exit 1 ; }
|
|
|
|
test -n "$BDIR" -a ! -d $RPM_BUILD_ROOT$BDIR && create_dir 0755 root root $BDIR
|
|
|
|
mkdir -m $MODE $RPM_BUILD_ROOT/$NAME
|
|
|
|
echo "$XTRA%%dir %%attr($MODE,$OWNR,$GRUP) $NAME" >> filesystem.list
|
|
|
|
}
|
|
|
|
mkdir -p $RPM_BUILD_ROOT
|
2010-09-16 12:20:28 +02:00
|
|
|
# generic directories first
|
2006-12-19 00:15:54 +01:00
|
|
|
echo "%%defattr(-,root,root)" > filesystem.list
|
|
|
|
{
|
|
|
|
cat %{SOURCE0}
|
2013-01-31 19:59:21 +01:00
|
|
|
%ifarch s390x %sparc x86_64 ppc64 ppc aarch64
|
2006-12-19 00:15:54 +01:00
|
|
|
cat %{SOURCE64}
|
|
|
|
%endif
|
2010-09-16 12:20:28 +02:00
|
|
|
} | while read MOD OWN GRP NAME ; do
|
|
|
|
create_dir $MOD $OWN $GRP $NAME
|
|
|
|
done
|
|
|
|
# ghost files next
|
|
|
|
cat %{SOURCE3} | while read MOD OWN GRP NAME ; do
|
2006-12-19 00:15:54 +01:00
|
|
|
%ifarch s390 s390x
|
|
|
|
case $NAME in
|
2010-09-16 12:20:28 +02:00
|
|
|
/media/floppy|/media/cdrom) continue ;;
|
2006-12-19 00:15:54 +01:00
|
|
|
esac
|
|
|
|
%endif
|
2010-09-16 12:20:28 +02:00
|
|
|
create_dir $MOD $OWN $GRP $NAME "%%verify(not mode) %%ghost "
|
2006-12-19 00:15:54 +01:00
|
|
|
done
|
2010-09-16 12:20:28 +02:00
|
|
|
# arch specific leftovers
|
2006-12-19 00:15:54 +01:00
|
|
|
for march in \
|
|
|
|
%ifarch %ix86
|
|
|
|
i586-suse-linux \
|
|
|
|
%else
|
2009-12-18 14:58:13 +01:00
|
|
|
%ifarch %sparc
|
|
|
|
sparc-suse-linux sparc64-suse-linux \
|
|
|
|
%else
|
2006-12-19 00:15:54 +01:00
|
|
|
%ifarch ppc
|
|
|
|
powerpc-suse-linux \
|
|
|
|
%else
|
|
|
|
%ifarch ppc64
|
|
|
|
powerpc64-suse-linux \
|
|
|
|
%else
|
2009-08-10 17:58:33 +02:00
|
|
|
%ifarch %arm
|
|
|
|
%{_target_cpu}-suse-linux-gnueabi \
|
|
|
|
%else
|
2006-12-19 00:15:54 +01:00
|
|
|
%{_target_cpu}-suse-linux \
|
|
|
|
%endif
|
|
|
|
%endif
|
2009-08-10 17:58:33 +02:00
|
|
|
%endif
|
2009-12-18 14:58:13 +01:00
|
|
|
%endif
|
2006-12-19 00:15:54 +01:00
|
|
|
%endif
|
|
|
|
; do
|
|
|
|
create_dir 0755 root root /usr/$march
|
|
|
|
for xdir in bin include lib ; do
|
|
|
|
create_dir 0755 root root /usr/$march/$xdir
|
|
|
|
done
|
|
|
|
done
|
|
|
|
%ifarch ia64
|
|
|
|
create_dir 0755 root root /emul/ia32-linux
|
|
|
|
%endif
|
|
|
|
# now do the links
|
|
|
|
while read SRC DEST ; do
|
|
|
|
case $SRC in
|
|
|
|
"") continue ;;
|
|
|
|
\#*) echo "comment: $SRC $DEST" ;;
|
|
|
|
*)
|
|
|
|
case $SRC in
|
|
|
|
/*) test -d $RPM_BUILD_ROOT/$SRC || { echo "link src does not exist" ; exit 1 ; }
|
|
|
|
;;
|
|
|
|
*) test -d $RPM_BUILD_ROOT/`dirname $DEST`/$SRC || { echo "link src does not exist" ; exit 1 ; }
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
ln -sf $SRC $RPM_BUILD_ROOT$DEST
|
|
|
|
echo "%%dir $DEST" >> filesystem.list
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done < %{SOURCE1}
|
|
|
|
# Create the locale directories:
|
|
|
|
while read LANG ; do
|
|
|
|
create_dir 0755 root root /usr/share/locale/$LANG/LC_MESSAGES
|
2012-03-14 10:17:37 +01:00
|
|
|
create_dir 0755 root root /usr/share/help/$LANG
|
2006-12-19 00:15:54 +01:00
|
|
|
done < %{SOURCE2}
|
2012-09-04 15:54:41 +02:00
|
|
|
# Create the locale directories for man:
|
|
|
|
while read LANG ; do
|
|
|
|
create_dir 0755 root root /usr/share/man/$LANG
|
|
|
|
for sec in 1 2 3 4 5 6 7 8 9 n; do
|
|
|
|
create_dir 0755 root root /usr/share/man/$LANG/man$sec
|
|
|
|
done
|
|
|
|
done < %{SOURCE4}
|
|
|
|
|
2006-12-19 00:15:54 +01:00
|
|
|
RPM_INSTALL_PREFIX=$RPM_BUILD_ROOT
|
|
|
|
export RPM_BUILD_ROOT
|
|
|
|
# check, if all home directories are present.
|
|
|
|
UNFOUND=false
|
|
|
|
UNFOUND_DIRS=
|
|
|
|
OLDIFS="$IFS"
|
|
|
|
IFS=":"
|
|
|
|
while read LOGIN PASSWD UID_T GID_T NAME HOME_DIR SHELL_T ; do
|
|
|
|
test "$LOGIN" = "abuild" && continue
|
|
|
|
test "$LOGIN" = "icecream" && continue
|
|
|
|
test -n "$HOME_DIR" || continue
|
|
|
|
test "$UID_T" -gt 100 && continue
|
|
|
|
test -d $RPM_BUILD_ROOT/$HOME_DIR && continue
|
|
|
|
echo $HOME_DIR does not exist.
|
|
|
|
UNFOUND=true
|
|
|
|
UNFOUND_DIRS="$UNFOUND_DIRS $HOME_DIR"
|
|
|
|
done < /etc/passwd
|
|
|
|
IFS=$OLDIFS
|
|
|
|
if test "$UNFOUND" = true ; then
|
|
|
|
echo There are home directories defined, which are not present.
|
|
|
|
echo Unfound: $UNFOUND_DIRS
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
#
|
|
|
|
# now check, if all files of aaa_base have a directory in this package
|
|
|
|
#
|
|
|
|
NON_EXISTING_DIR=
|
|
|
|
for FILE in `rpm -ql aaa_base` ; do
|
|
|
|
test -d $FILE && continue
|
|
|
|
case $FILE in
|
2012-10-15 15:16:06 +02:00
|
|
|
/sbin/init.d*|/usr/share/doc/support/*|/lib/mkinitrd/scripts/*)
|
2006-12-19 00:15:54 +01:00
|
|
|
continue
|
|
|
|
;;
|
2011-08-22 16:27:40 +02:00
|
|
|
/usr/share/doc/packages/aaa_base/*|/lib/aaa_base/*)
|
2011-08-22 16:23:02 +02:00
|
|
|
continue
|
|
|
|
;;
|
2006-12-19 00:15:54 +01:00
|
|
|
esac
|
|
|
|
test -d $RPM_BUILD_ROOT/`dirname $FILE` || {
|
|
|
|
echo `dirname $FILE` for $FILE is not in filesystem.
|
|
|
|
NON_EXISTING_DIR="$NON_EXISTING_DIR `dirname $FILE`"
|
|
|
|
}
|
|
|
|
done
|
|
|
|
test -n "$NON_EXISTING_DIR" && {
|
|
|
|
echo NON_EXISTING_DIR=$NON_EXISTING_DIR
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
%pre -p <lua>
|
|
|
|
os.remove ("/usr/include/X11")
|
|
|
|
os.remove ("/usr/lib/X11")
|
|
|
|
|
|
|
|
%files -f filesystem.list
|
|
|
|
|
2007-02-22 14:14:58 +01:00
|
|
|
%changelog
|