From 394c22a2b4cf3f1cab03a3bf06fce22c9652fac8 Mon Sep 17 00:00:00 2001 From: freesource Date: Fri, 20 Dec 2002 16:25:52 +0000 Subject: [PATCH] Now the rpm src and binary package properly build as a normal user. --- gbootroot_pkg | 19 ++++++++++++------ pkg/rpm/gbootroot-mdk.spec | 40 +++++++++++++++++++++++++------------- pkg/rpm/gbootroot.spec | 40 ++++++++++++++++++++++++-------------- 3 files changed, 64 insertions(+), 35 deletions(-) diff --git a/gbootroot_pkg b/gbootroot_pkg index e5ae7ec..2babbb2 100755 --- a/gbootroot_pkg +++ b/gbootroot_pkg @@ -72,9 +72,9 @@ my $makefile = "Makefile.pkg"; # RPM stuff - a filelist is used my $rpm_packaging_place = "$gbootroot_cvs/pkg/rpm"; -my $SPECS = "/usr/src/rpm/SPECS"; -my $SOURCES = "/usr/src/rpm/SOURCES"; -my $BUILD = "/usr/src/rpm/BUILD"; +my $SPECS = "$ENV{HOME}/gbootroot/SPECS"; +my $SOURCES = "$ENV{HOME}/gbootroot/SOURCES"; +my $BUILD = "$ENV{HOME}/gbootroot/BUILD"; my @rpm_packages = qw(gbootroot.spec gbootroot-mdk.spec); #my @rpm_packages = qw(gbootroot-mdk.spec); @@ -244,10 +244,11 @@ chdir($packaging_place_orig); unlink($pristine_source_package) if -e $pristine_source_package; system "tar cvfz $pristine_source_package $prog-$version"; print "$pristine_source_package $packaging_place\n"; - +system "rm -rf $packaging_place_orig/gbootroot_$version*"; # Now we to the dh_make thing, and setup the time, version, and defaults. + chdir($packaging_place) or die "Can't change to $packaging_place: $!\n"; system "dh_make -e $email"; @@ -347,6 +348,13 @@ if ( $ARGV[0] eq "both" || $ARGV[0] eq "rpm" ) { # Here the defined version and revision are updated .. # Ofcourse maybe the revision shouldn't be touched. + + # The pristine source package is made once for debian, but + # a source package specific to rpm is made more than once. + + my $source = dirname($packaging_place) . "/" . $prog . "-" . $version; + system "mv $source.tar.gz $source-pristine.tar.gz"; + foreach my $package ( @rpm_packages ) { open (RPM_PLACE, "$rpm_packaging_place/$package" ) or die "Couldn't open up $rpm_packaging_place/$package: $!\n"; @@ -427,14 +435,13 @@ if ( $ARGV[0] eq "both" || $ARGV[0] eq "rpm" ) { next; } } - print FILELIST "$_"; + print FILELIST "%attr(- root root) $_"; } } # For now will just use one definite place for SOURCES my $filelist = "pkg/rpm"; - my $source = dirname($packaging_place) . "/" . $prog . "-" . $version; system "cp $gbootroot_cvs/gbootroot.xpm $SOURCES"; system "cp $rpm_packaging_place/$package $SPECS"; system "install -d $packaging_place/$filelist"; diff --git a/pkg/rpm/gbootroot-mdk.spec b/pkg/rpm/gbootroot-mdk.spec index a55d92d..37a00b9 100644 --- a/pkg/rpm/gbootroot-mdk.spec +++ b/pkg/rpm/gbootroot-mdk.spec @@ -1,16 +1,20 @@ # SPEC designed for Mandrake and Mandrake-type rpm-based distribution which # use perl and perl-base. -# Set topdir in .rpmrcmacros .. %_topdir /usr/src/rpm -# cd /usr/src/redhat/SPECS -# place sources in /usr/src/redhat/SOURCES/ -# cp gbootroot.xpm /usr/src/redhat/SOURCES/ -# rpm -ba gbootroot.spec - +# cd %{_topdir}/SPECS +# place rpm source in %{_topdir}/SOURCES/ +# optional: place linux*bz2, uml_patch* uml_utilities* in +# $HOME/gbootroot/gbootroot/sources +# cp gbootroot.xpm %{_topdir}/SOURCES/ +# rpm -ba %{_topdir}/SPECS/gbootroot.spec # Update this according to version, and if you want to copy in your own -# sources define base_dir and put them in source_dir. Define filelist if -# you want it included in the sources. +# sources define base_dir and put them in source_dir. You can build this +# package as a normal user, just make sure to adjust _topdir so that +# /home/mttrader is your own echo $HOME, for instance, /home/person. + +%define home /home/mttrader +%define _topdir %{home}/gbootroot %define version 1.4.0 %define release 1mdk %define kversion 2.4.19 @@ -19,11 +23,12 @@ %define kernel_source linux-%{kversion}.tar.bz2 %define patch_1 uml-patch-%{kversion}-%{patch_version}.bz2 %define utilities uml_utilities_%{util_ver}.tar.bz2 -%define base_dir /home/mttrader/gbootroot/gbootroot +%define base_dir %{home}/gbootroot/gbootroot %define source_dir %{base_dir}/sources %define build_dir /gbootroot-%{version} %define filelist %{base_dir}/pkg/rpm/filelist + Summary: Boot/Root Filesystem Distribution testing and creation. Name: gbootroot Version: %{version} @@ -44,7 +49,7 @@ Icon: gbootroot.xpm # Extras #Patch: gbootroot-1.3.4-buildroot.patch -#Buildroot: /home/somebody +Buildroot: /tmp/gbootroot # Dependencies .. can you have two alternative deps like with deb? @@ -75,7 +80,13 @@ as mdk. %prep %setup -n gbootroot-%{version} -chown -R root:root . +#chown -R root:root . +mkdir /tmp/gbootroot +install -d $HOME/gbootroot/RPMS/i386 +install -d $HOME/gbootroot/BUILD +install -d $HOME/gbootroot/SOURCES +install -d $HOME/gbootroot/SPECS +install -d $HOME/gbootroot/SRPMS if [ ! -e $RPM_BUILD_DIR/%{build_dir}/sources/%{kernel_source} ] ; then if [ -e %{source_dir}/%{kernel_source} ] ; then cp -fa %{source_dir}/%{kernel_source} $RPM_BUILD_DIR/%{build_dir}/sources; @@ -96,19 +107,20 @@ fi; make %install -make install +make DESTDIR=$RPM_BUILD_ROOT install %clean #make clean #make clean-sources +rm -rf $RPM_BUILD_ROOT # Update this as necessary # dswim -ql gbootroot > ~/gbootroot/gbootroot/list # will read this all from a files list %files -f filelist %files -f %{_topdir}/BUILD/%{build_dir}/pkg/rpm/filelist -%docdir /usr/share/doc/gbootroot +%attr(- root root) %docdir /usr/share/doc/gbootroot %attr(4755, root, root) /usr/bin/uml_net -%config /etc/gbootroot/gbootrootrc +%attr(- root root) %config /etc/gbootroot/gbootrootrc # Just include this diff --git a/pkg/rpm/gbootroot.spec b/pkg/rpm/gbootroot.spec index 91329c3..866e933 100644 --- a/pkg/rpm/gbootroot.spec +++ b/pkg/rpm/gbootroot.spec @@ -1,15 +1,20 @@ # SPEC designed for RedHat and RedHat-type rpm-based distribution which # just use perl, and not perl-base. -# Set topdir in .rpmrcmacros .. %_topdir /usr/src/rpm -# cd /usr/src/redhat/SPECS -# place sources in /usr/src/redhat/SOURCES/ -# cp gbootroot.xpm /usr/src/redhat/SOURCES/ -# rpm -ba gbootroot.spec +# cd %{_topdir}/SPECS +# place rpm source in %{_topdir}/SOURCES/ +# optional: place linux*bz2, uml_patch* uml_utilities* in +# $HOME/gbootroot/gbootroot/sources +# cp gbootroot.xpm %{_topdir}/SOURCES/ +# rpm -ba %{_topdir}/SPECS/gbootroot.spec # Update this according to version, and if you want to copy in your own -# sources define base_dir and put them in source_dir. Define filelist if -# you want it included in the sources. +# sources define base_dir and put them in source_dir. You can build this +# package as a normal user, just make sure to adjust _topdir so that +# /home/mttrader is your own echo $HOME, for instance, /home/person. + +%define home /home/mttrader +%define _topdir %{home}/gbootroot %define version 1.4.0 %define release 1 %define kversion 2.4.19 @@ -18,7 +23,7 @@ %define kernel_source linux-%{kversion}.tar.bz2 %define patch_1 uml-patch-%{kversion}-%{patch_version}.bz2 %define utilities uml_utilities_%{util_ver}.tar.bz2 -%define base_dir /home/mttrader/gbootroot/gbootroot +%define base_dir %{home}/gbootroot/gbootroot %define source_dir %{base_dir}/sources %define build_dir /gbootroot-%{version} %define filelist %{base_dir}/pkg/rpm/filelist @@ -41,11 +46,9 @@ Packager: Jonathan Rosenbaum # Place icon in rpm sources directory prior to build Icon: gbootroot.xpm - # Extras #Patch: gbootroot-1.3.4-buildroot.patch -#Buildroot: /home/somebody - +Buildroot: /tmp/gbootroot # Dependencies .. can you have two alternative deps like with deb? PreReq: Gtk-Perl >= 0.7002 @@ -75,7 +78,13 @@ as mdk. %prep %setup -n gbootroot-%{version} -chown -R root:root . +#chown -R root:root . +mkdir /tmp/gbootroot +install -d $HOME/gbootroot/RPMS/i386 +install -d $HOME/gbootroot/BUILD +install -d $HOME/gbootroot/SOURCES +install -d $HOME/gbootroot/SPECS +install -d $HOME/gbootroot/SRPMS if [ ! -e $RPM_BUILD_DIR/%{build_dir}/sources/%{kernel_source} ] ; then if [ -e %{source_dir}/%{kernel_source} ] ; then cp -fa %{source_dir}/%{kernel_source} $RPM_BUILD_DIR/%{build_dir}/sources; @@ -97,19 +106,20 @@ fi; make %install -make install +make DESTDIR=$RPM_BUILD_ROOT install %clean #make clean #make clean-sources +rm -rf $RPM_BUILD_ROOT # Update this as necessary # dswim -ql gbootroot > ~/gbootroot/gbootroot/list # will read this all from a files list %files -f filelist %files -f %{_topdir}/BUILD/%{build_dir}/pkg/rpm/filelist -%docdir /usr/share/doc/gbootroot +%attr(- root root) %docdir /usr/share/doc/gbootroot %attr(4755, root, root) /usr/bin/uml_net -%config /etc/gbootroot/gbootrootrc +%attr(- root root) %config /etc/gbootroot/gbootrootrc # Just include this ##/usr/lib/menu/gbootroot