Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.2:Test
openSUSE-images
openSUSE-images.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File openSUSE-images.spec of Package openSUSE-images
# # spec file for package openSUSE-images (Version 11.2) # # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. # # 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. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # # needsrootforbuild # needsbinariesforbuild Name: openSUSE-images BuildRequires: createrepo package-lists-openSUSE-images xz BuildRequires: ghostscript-fonts-std ghostscript-library BuildRequires: bundle-lang-common-en bundle-lang-gnome-en bundle-lang-kde-en BuildRequires: dummy-release kernel-default openSUSE-build-key #!BuildIgnore: openSUSE-release #!BuildIgnore: suspend Summary: Creates preinstalled images of patterns Version: 11.2 Release: 14.<RELEASE2> Group: Metapackages License: BSD 3-clause (or similar) BuildRoot: %{_tmppath}/%{name}-%{version}-build Source: common_tree Source1: images.xml.in ExcludeArch: ia64 ppc ppc64 s390x s390 # do not compress the ISO - takes ages %define _binary_payload w.ufdio %description This will install most default packages and create tar images for faster installation %prep %setup -T -c %build createrepo /.build.binaries install_repo() { set +e root=$1 file=$2 export YAST_IS_RUNNING=1 export ZYPP_MODALIAS_SYSFS=/tmp mkdir -p $root/home/rpmdir $root/proc $root/sys mkdir -p $root/dev mkdir -m 755 -p $root/dev/pts mknod -m 666 $root/dev/null c 1 3 mknod -m 666 $root/dev/zero c 1 5 mknod -m 622 $root/dev/full c 1 7 mknod -m 666 $root/dev/random c 1 8 mknod -m 644 $root/dev/urandom c 1 9 mknod -m 666 $root/dev/tty c 5 0 mknod -m 666 $root/dev/ptmx c 5 2 ln -s /proc/self/fd $root/dev/fd ln -s fd/2 $root/dev/stderr ln -s fd/0 $root/dev/stdin ln -s fd/1 $root/dev/stdout mknod -m 640 $root/dev/loop0 b 7 0 mknod -m 640 $root/dev/loop1 b 7 1 mknod -m 640 $root/dev/loop2 b 7 2 mknod -m 640 $root/dev/loop3 b 7 3 mkdir -p $root/etc touch $root/etc/mtab cp /var/adm/fillup-templates/passwd.aaa_base $root/etc/passwd cp /var/adm/fillup-templates/group.aaa_base $root/etc/group ret=0 ZYPPER="zypper --root $root --non-interactive --no-gpg-checks" mount -o bind,ro /.build.binaries $root/home/rpmdir mount -o bind /dev $root/dev mount -o bind /proc $root/proc mount -o bind /sys $root/sys cp /.buildenv $root for key in sigs/gpg-pubke*; do rpm -r $root --import $key done # mount -t sysfs none $root/sys $ZYPPER addrepo file:$root/home/rpmdir InstallationImage || ret=1 $ZYPPER ref $ZYPPER in --auto-agree-with-licenses `cat /usr/share/suse/packages/$file` || ret=1 rpm -r $root -qa --qf "[%{NAME}\n]" | LC_ALL=C sort -u > $file diff -U 0 /usr/share/suse/packages/$file $file list=`diff -u /usr/share/suse/packages/$file $file | grep -v +++ | grep ^+ | grep -v gpg-pubkey | cut -b2-` if test -n "$list"; then for pkg in $list; do # can't use percent-S in spec files... date=`date +"%Y-%m-%d %H:%M:59"` vers=`rpm -r $root -q --qf '%{VERSION}-%{RELEASE}' $pkg` arch=`rpm -r $root -q --qf '%{ARCH}' $pkg` echo "$date|remove |$pkg|$vers|$arch|root@opensuse" >> $root/var/log/zypp/history rpm -v --nodeps -r $root -e $pkg || ret=1 done fi sed -i -e 's,|root@build[0-9]*,|root@opensuse,' $root/var/log/zypp/history # update System.solv $ZYPPER ref $ZYPPER rr InstallationImage umount -f $root/home/rpmdir rmdir $root/home/rpmdir rm $root/.buildenv umount -f $root/proc umount $root/sys umount -f $root/dev set -e if test "$ret" = 1; then exit 1 fi } mkdir sigs cd sigs /usr/lib/rpm/gnupg/dumpsigs /usr/lib/rpm/gnupg/pubring.gpg cd .. for i in kde4_cd-base gnome_cd-x11 gnome_cd kde4_cd; do file=$i-default.%{_target_cpu}.list install_repo $PWD/$i $file mkdir -p $i-meta/var/lib/rpm $i-meta/var/cache/zypp rm -rf $i/var/cache/zypp/raw/ rm -rf $i/var/cache/zypp/repo.* $i/etc/zypp/repos.d/repo.repo $i/var/cache/zypp/solv/repo rm -f $i/var/lib/zypp/AnonymousUniqueId mv $i/var/lib/rpm/* $i-meta/var/lib/rpm mv $i/var/cache/zypp/* $i-meta/var/cache/zypp mv $file $i.rpms done rm -rf sigs perl %SOURCE0 --dst common-desktop --prim kde4_cd --sec gnome_cd perl %SOURCE0 --dst common-xorg --prim gnome_cd-x11 --sec common-desktop perl %SOURCE0 --dst common-base --prim kde4_cd-base --sec common-xorg # non-confusing names mv gnome_cd-meta gnome-meta mv gnome_cd gnome mv gnome_cd-x11-meta x11-meta mv gnome_cd-x11 x11 mv gnome_cd-x11.rpms x11.rpms mv kde4_cd-base-meta base-meta mv kde4_cd-base base mv kde4_cd-base.rpms base.rpms mv kde4_cd-meta kde-meta mv kde4_cd kde mv kde4_cd.rpms kde.rpms %install mkdir -p $RPM_BUILD_ROOT/CD1/images COMP="xz -5 -c -v" EXT=xz cpu=%_target_cpu case $cpu in i*86) cpu=i386 ;; esac cat > $RPM_BUILD_ROOT/CD1/images/details-$cpu.xml <<EOF <?xml version="1.0"?> <!DOCTYPE details> <image_installation_details xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns"> <details config:type="list" > EOF for i in *; do test -d $i || continue cd $i tar cf ../$i.tar * cd .. $COMP $i.tar > $RPM_BUILD_ROOT/CD1/images/$i-$cpu.tar.$EXT usize=$(stat --terse --format=%s $i.tar) rm $i.tar ( echo "<image>" echo " <file>$i-$cpu.tar.$EXT</file>" case $i in *-meta) echo " <rpms config:type=\"list\">" for r in `cat ${i/-meta/}.rpms`; do echo " <rpm>$r</rpm>" done echo " </rpms>" ;; esac echo " <size>$usize</size>" echo "</image>" ) >> $RPM_BUILD_ROOT/CD1/images/details-$cpu.xml done cat >> $RPM_BUILD_ROOT/CD1/images/details-$cpu.xml <<EOF </details> </image_installation_details> EOF cat > $RPM_BUILD_ROOT/CD1/images/images.xml <<EOF <?xml version="1.0"?> <!DOCTYPE images> <image_installation xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns"> <image_sets config:type="list" > EOF for arch in i386 x86_64 ppc; do sed -e "s,@ARCH@,$arch,g" %SOURCE1 >> $RPM_BUILD_ROOT/CD1/images/images.xml done cat >> $RPM_BUILD_ROOT/CD1/images/images.xml <<EOF </image_sets> </image_installation> EOF size=`du -s $RPM_BUILD_ROOT/CD1/images/ | cut -f1` if test $size -gt 500000; then echo "this looks unreasonable" exit 1 fi %files %defattr(-, root, root) /CD1 %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor