slitaz-arm rev 213

Add tazprm
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu May 05 14:58:15 2016 +0200 (2016-05-05)
parents 3b857a987d2b
children 9c7847becd6b
files rpi/tazbian rpi/tazrpm
line diff
     1.1 --- a/rpi/tazbian	Wed Mar 30 01:27:39 2016 +0300
     1.2 +++ b/rpi/tazbian	Thu May 05 14:58:15 2016 +0200
     1.3 @@ -10,13 +10,14 @@
     1.4  
     1.5  [ $(id -u) -ne 0 ] && echo "Must be root. Abort." && exit 1
     1.6  
     1.7 -REVISION=2
     1.8 +REVISION=3
     1.9  DESTDIR=var/os/slitaz
    1.10  DESCRIPTION="Tiny Linux distribution with multi boot features"
    1.11  LONG_DESCRIPTION="SliTaz can run fully in RAM or can be installed \
    1.12  on the SD card in a\nsubdirectory of your Raspbian (example /$DESTDIR)."
    1.13  WEB_SITE="http://arm.slitaz.org/rpi/"
    1.14  MAINTAINER="Pascal Bellard <pascal.bellard@slitaz.org>"
    1.15 +LICENSE=GPL
    1.16  
    1.17  tazpkg()
    1.18  {
    1.19 @@ -59,6 +60,7 @@
    1.20  for file in $(sed '/rpi-base/!d;q' index) $(sed '/rpi-desktop/!d;q' index); do
    1.21  	echo "Get $file "
    1.22  	wget -O - $URL$file | tar xjf -
    1.23 +	WGET_URL=$URL$file
    1.24  done
    1.25  
    1.26  mkdir -p fs/$DESTDIR fs/boot/slitaz fs/boot/slitaz-base fs/boot/slitaz-live \
    1.27 @@ -230,7 +232,7 @@
    1.28  readonly
    1.29  #noedit
    1.30  #nowebboot
    1.31 -#webpath=http://my.home.web.site/pxe/rpi/index.php http://or.this.one/rpi.txt
    1.32 +#webpath=http://my.home.web.site/pxe/rpi/index.php,http://or.this.one/rpi.txt
    1.33  EOM
    1.34  echo "entry=$menustr" > /boot/$raspos/menu.txt
    1.35  KERNEL=\$(sed '/^kernel/!d;s/.*=//' /boot/config.txt)
    1.36 @@ -377,7 +379,7 @@
    1.37  packager = $MAINTAINER
    1.38  size = $(du -s . | awk "{ print \$1*1024+$LIVESZ }")
    1.39  arch = armv6h
    1.40 -license = GPL
    1.41 +license = $LICENSE
    1.42  EOT
    1.43  	cat > .INSTALL <<EOT
    1.44  post_install() {
    1.45 @@ -398,6 +400,49 @@
    1.46  	ls -l slitaz-$VERSION-armv6h.pkg.tar.gz
    1.47  }
    1.48  
    1.49 +pkgrpm()
    1.50 +{
    1.51 +	cat > rpm.spec <<EOT
    1.52 +%define desktop_vendor newrpms
    1.53 +%{!?_dist: %{expand: %%define dist rhfc14}}
    1.54 +
    1.55 +Name:		slitaz
    1.56 +Version:	$VERSION
    1.57 +Release:	$REVISION
    1.58 +Summary:	$DESCRIPTION
    1.59 +License:	$LICENSE
    1.60 +Group:		System Environment/Boot loader
    1.61 +URL:		$WEB_SITE
    1.62 +Source0:	$WGET_URL
    1.63 +ExclusiveArch:	arm
    1.64 +Distribution:	$raspos
    1.65 +Packager:	$MAINTAINER
    1.66 +BuildRoot:	$PWD/fs
    1.67 +
    1.68 +%description
    1.69 +$(echo -e "$LONG_DESCRIPTION")
    1.70 +
    1.71 +%post
    1.72 +$(mkpostinst)
    1.73 +
    1.74 +%postun
    1.75 +$(mkdisable)
    1.76 +$(mkpurge)
    1.77 +
    1.78 +%files
    1.79 +
    1.80 +%defattr(0755, root, root)
    1.81 +/boot
    1.82 +/var/os/slitaz
    1.83 +EOT
    1.84 +	rpmbuild -bb --target=arm --buildroot=$PWD/fs rpm.spec
    1.85 +	mv ~/rpmbuild/RPMS/arm/slitaz-$VERSION-$REVISION-arm.rpm $CURDIR
    1.86 +	cd $CURDIR
    1.87 +	rm -rf $TMPDIR
    1.88 +	ls -l slitaz-$VERSION-$REVISION-arm.rpm
    1.89 +
    1.90 +}
    1.91 +
    1.92  case "$(basename $0)" in
    1.93  tazarch)
    1.94  	raspos=archarm
    1.95 @@ -405,6 +450,14 @@
    1.96  	buildfs
    1.97  	pkgarch
    1.98  	;;
    1.99 +tazrpm)
   1.100 +	[ -x /usr/bin/rpmbuild ] || tazpkg get-install rpm4
   1.101 +	[ -e /usr/share/misc/magic.mgc ] || tazpkg get-install file
   1.102 +	raspos=pidora
   1.103 +	menustr="\$(cat /etc/pidora-release)"
   1.104 +	buildfs
   1.105 +	pkgrpm
   1.106 +	;;
   1.107  *)
   1.108  	[ -x /usr/bin/ar -o -x /bin/ar ] || tazpkg get-install binutils
   1.109  	raspos=raspbian
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/rpi/tazrpm	Thu May 05 14:58:15 2016 +0200
     2.3 @@ -0,0 +1,1 @@
     2.4 +tazbian
     2.5 \ No newline at end of file