diff --git a/Makefile b/Makefile index 6eb8d0f..d39c4ec 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # Makefile for desktop-base-openmamba package -# Copyright (C) 2004-2013 by Silvan Calarco +# Copyright (C) 2004-2014 by Silvan Calarco # Copyright (C) 2005-2007 by Davide Madrisan include VERSION @@ -121,13 +121,7 @@ pck_catalogs3 := $(wildcard openmamba-update/po/*.po) s,@distrodesktopdir@,$(distrodesktopdir),g;\ s,@distrosrpmsdir@,$(distrosrpmsdir),g;\ s,@wallpaper@,$(DEFAULT_WALLPAPER),g;\ - s,@screensaver@,${SCREENSAVER},g;\ - s,@flashpluginver@,${FLASHPLUGIN_VERSION},g;\ - s,@win32codecsver@,${WIN32CODECS_VERSION},g;\ - s,@sunjava7ver@,${SUN_JAVA7_VERSION},g;\ - s,@virtualboxextensionpackver@,${VIRTUALBOX_EXTENSION_PACK_VERSION},g;\ - s,@spotifyver@,${SPOTIFY_VERSION},g;\ - s,@skypever@,${SKYPE_VERSION},g" $< > $@ + s,@screensaver@,${SCREENSAVER},g" $< > $@ all: dist-update locales @@ -224,9 +218,9 @@ install-srpms: @$(INSTALL_DIR) $(DESTDIR)$(sysconfigdir) @cat $(SRPMSVERSIONSFILE) > $(DESTDIR)$(sysconfigdir)/$(SYSCONFIGFILE) for pck in $(pck_srpms); do\ - rpmbuild -bs SRPMS/$$pck/$${pck}.spec \ - --define="_sourcedir `pwd`/SRPMS/$$pck" \ - --define="_srcrpmdir $(DESTDIR)$(distrosrpmsdir)" || exit 1;\ + cp -a SRPMS/$$pck $(DESTDIR)$(distrosrpmsdir); \ + rm -f $(DESTDIR)$(distrosrpmsdir)/$$pck/distroutils.sysconfig*; \ + rm -f $(DESTDIR)$(distrosrpmsdir)/$$pck/*.spec.in; \ cat SRPMS/$$pck/$(pck_sysconfigfile) >> \ $(DESTDIR)$(sysconfigdir)/$(SYSCONFIGFILE);\ done diff --git a/SRPMS/flashplugin/distroutils.sysconfig.in b/SRPMS/flashplugin/distroutils.sysconfig.in index 25eed71..5f79a4e 100644 --- a/SRPMS/flashplugin/distroutils.sysconfig.in +++ b/SRPMS/flashplugin/distroutils.sysconfig.in @@ -4,4 +4,4 @@ FLASH_PLUGIN_PCK=install_flash_player_11_linux.@arch@.tar.gz # package URL (do not modify unless you know what you're doing) -FLASH_PLUGIN_URL=http://fpdownload.macromedia.com/get/flashplayer/pdc/${FLASHPLUGIN_VERSION}/ +FLASH_PLUGIN_URL=http://fpdownload.macromedia.com/get/flashplayer/pdc/${SRPMVERSION["flashplugin"]}/ diff --git a/SRPMS/flashplugin/flashplugin.spec.in b/SRPMS/flashplugin/flashplugin.spec.in index dff0e04..bf1da47 100644 --- a/SRPMS/flashplugin/flashplugin.spec.in +++ b/SRPMS/flashplugin/flashplugin.spec.in @@ -1,6 +1,6 @@ Name: flashplugin -Version: @flashpluginver@ -Release: 1@distroext@ +Version: @SRPMVERSION@ +Release: @SRPMRELEASE@ Epoch: 1 Summary: Macromedia Flash plugin for web browsers Group: Applications/Web @@ -24,6 +24,7 @@ Macromedia Flash plugin for web browsers. %setup -c -n %{name}-%{version} -D -T [ -r /etc/sysconfig/@sysconfigfile@ ] || exit 1 +declare -A SRPMVERSION SRPMRELEASE . /etc/sysconfig/@sysconfigfile@ [ "${FLASH_PLUGIN_PCK}" ] || exit 1 diff --git a/SRPMS/skype/skype.spec.in b/SRPMS/skype/skype.spec.in index 76ff398..dff80bd 100644 --- a/SRPMS/skype/skype.spec.in +++ b/SRPMS/skype/skype.spec.in @@ -1,6 +1,6 @@ Name: skype -Version: @skypever@ -Release: @distroext@ +Version: @SRPMVERSION@ +Release: @SRPMRELEASE@ Epoch: 1 Summary: An Internet voice and video communication software Group: Graphical Desktop/Applications/Internet diff --git a/SRPMS/spotify/spotify.spec.in b/SRPMS/spotify/spotify.spec.in index 84381ea..2df7f6b 100644 --- a/SRPMS/spotify/spotify.spec.in +++ b/SRPMS/spotify/spotify.spec.in @@ -1,7 +1,7 @@ #% define spotify_make_ver 20130831git Name: spotify -Version: @spotifyver@ -Release: 1mamba +Version: @SRPMVERSION@ +Release: @SRPMRELEASE@ Summary: Listen to music using Spotify Group: Graphical Desktop/Applications/Multimedia Vendor: @vendor@ diff --git a/SRPMS/sun-java7/sun-java7.spec.in b/SRPMS/sun-java7/sun-java7.spec.in index 144bb1d..3eba6f3 100644 --- a/SRPMS/sun-java7/sun-java7.spec.in +++ b/SRPMS/sun-java7/sun-java7.spec.in @@ -22,8 +22,8 @@ %define cgibindir %{_var}/www/cgi-bin Name: sun-java7 -Version: @sunjava7ver@ -Release: 2@distroext@ +Version: @SRPMVERSION@ +Release: @SRPMRELEASE@ Epoch: 1 Summary: Sun Java Developer's Kit Group: System/Libraries/Java diff --git a/SRPMS/virtualbox-extension-pack/distroutils.sysconfig.in b/SRPMS/virtualbox-extension-pack/distroutils.sysconfig.in index 6562469..33c0a68 100644 --- a/SRPMS/virtualbox-extension-pack/distroutils.sysconfig.in +++ b/SRPMS/virtualbox-extension-pack/distroutils.sysconfig.in @@ -1,7 +1,7 @@ ## VirtualBox Extension Pack # package name (do not modify unless you know what you're doing) -VIRTUALBOX_EXTENSION_PACK_PCK=Oracle_VM_VirtualBox_Extension_Pack-@virtualboxextensionpackver@.vbox-extpack +VIRTUALBOX_EXTENSION_PACK_PCK=Oracle_VM_VirtualBox_Extension_Pack-${SRPMVERSION["virtualbox-extension-pack"]}.vbox-extpack # package URL (do not modify unless you know what you're doing) -VIRTUALBOX_EXTENSION_PACK_URL=http://download.virtualbox.org/virtualbox/@virtualboxextensionpackver@/ +VIRTUALBOX_EXTENSION_PACK_URL=http://download.virtualbox.org/virtualbox/${SRPMVERSION["virtualbox-extension-pack"]}/ diff --git a/SRPMS/virtualbox-extension-pack/virtualbox-extension-pack.spec.in b/SRPMS/virtualbox-extension-pack/virtualbox-extension-pack.spec.in index 33361f3..f771c8f 100644 --- a/SRPMS/virtualbox-extension-pack/virtualbox-extension-pack.spec.in +++ b/SRPMS/virtualbox-extension-pack/virtualbox-extension-pack.spec.in @@ -1,8 +1,8 @@ %define pck_majver %(echo %version | cut -d. -f1-3) %define pck_minver %(echo %version | cut -d. -f4) Name: virtualbox-extension-pack -Version: @virtualboxextensionpackver@ -Release: 1@distroext@ +Version: @SRPMVERSION@ +Release: @SRPMRELEASE@ Epoch: 1 Summary: VirtualBox Extension Pack Group: Applications/Emulators diff --git a/SRPMS/win32codecs/win32codecs.spec.in b/SRPMS/win32codecs/win32codecs.spec.in index 126d7ca..b9aea55 100644 --- a/SRPMS/win32codecs/win32codecs.spec.in +++ b/SRPMS/win32codecs/win32codecs.spec.in @@ -12,8 +12,8 @@ %define alt_url10 ftp://ftp10.mplayerhq.hu/MPlayer/releases/codecs/ Name: win32codecs -Version: @win32codecsver@ -Release: 1@distroext@ +Version: @SRPMVERSION@ +Release: @SRPMRELEASE@ Summary: Win32 native dll codecs Group: System/Multimedia Vendor: @vendor@ diff --git a/SRPMSVERSIONS b/SRPMSVERSIONS index c6a83d4..4a32bd7 100644 --- a/SRPMSVERSIONS +++ b/SRPMSVERSIONS @@ -1,6 +1,17 @@ -FLASHPLUGIN_VERSION=11.2.202.336 -WIN32CODECS_VERSION=20110131 -SKYPE_VERSION=4.2.0.13 -VIRTUALBOX_EXTENSION_PACK_VERSION=4.3.8 -SUN_JAVA7_VERSION=7u51 -SPOTIFY_VERSION=20140117 +SRPMVERSION["flashplugin"]=11.2.202.394 +SRPMRELEASE["flashplugin"]=1mamba + +SRPMVERSION["win32codecs"]=20110131 +SRPMRELEASE["win32codecs"]=1mamba + +SRPMVERSION["skype"]=4.3.0.37 +SRPMRELEASE["skype"]=1mamba + +SRPMVERSION["virtualbox-extension-pack"]=4.3.12 +SRPMRELEASE["virtualbox-extension-pack"]=1mamba + +SRPMVERSION["sun-java7"]=7u51 +SRPMRELEASE["sun-java7"]=2mamba + +SRPMVERSION["spotify"]=20140117 +SRPMRELEASE["spotify"]=1mamba diff --git a/SRPMSVERSIONS.arm b/SRPMSVERSIONS.arm index a18e001..af44fae 100644 --- a/SRPMSVERSIONS.arm +++ b/SRPMSVERSIONS.arm @@ -1 +1,2 @@ -SUN_JAVA7_VERSION=7u51 +SRPMVERSION["sun-java7"]=7u51 +SRPMRELEASE["sun-java7"]=2mamba diff --git a/openmamba-update/openmamba-netsrpms b/openmamba-update/openmamba-netsrpms index 330bcf9..c0d3f0c 100755 --- a/openmamba-update/openmamba-netsrpms +++ b/openmamba-update/openmamba-netsrpms @@ -43,22 +43,22 @@ function check_if_already_installed() { fi } +declare -A SRPMVERSION SRPMRELEASE +. /etc/sysconfig/netsrpminstall || exit 1 + for pckname in $PACKAGES; do icon=`grep Icon= /usr/share/applications/openmamba-$pckname.desktop | sed "s|Icon=||"` - SRPM_NAME=`\ - find $DISTRO_SRPMS_DIR \ - -regex ".*/${pckname//+/\\+}-[^-]*-[^-]*" -printf "%f " 2>/dev/null` + SRPM_PATH=$DISTRO_SRPMS_DIR/${pckname} + SPEC_PATHNAME=$SRPM_PATH/${pckname}.spec - [ "$SRPM_NAME" ] || { + [ "$SPEC_PATHNAME" ] || { echo $"$me: $pckname is missing in $DISTRO_SRPMS_DIR; aborting." exit 255 } - SRPM_VERSION=`\ - echo $SRPM_NAME | \ - sed "s|${pckname//+/\\+}-\([^-]*-[^-]*\).src.rpm|\1|" 2>/dev/null` + SPEC_VERSION=${SRPMVERSION[${pckname}]}-${SRPMRELEASE[${pckname}]} RPM_INSTALLED=`rpm -q $pckname` [ $? -eq 0 ] || RPM_INSTALLED= @@ -69,10 +69,10 @@ for pckname in $PACKAGES; do echo $"Package name: $pckname" echo $"Installed version: $RPM_INSTALLED_VERSION" - echo $"Last version: $SRPM_VERSION" + echo $"Last version: $SPEC_VERSION" echo - if [ "$RPM_INSTALLED_VERSION" != "$SRPM_VERSION" ]; then + if [ "$RPM_INSTALLED_VERSION" != "$SPEC_VERSION" ]; then if [ "$RPM_INSTALLED_VERSION" ]; then UPDATE_NEEDED=1 elif [ "$UPGRADE_MODE" ]; then @@ -83,36 +83,14 @@ for pckname in $PACKAGES; do fi if [ ! "$CHECK_MODE" ]; then - SRPM_PATH=${DISTRO_SRPMS_DIR}/${SRPM_NAME} - - if [ ! -f $SRPM_PATH ]; then - echo "$me: "$"missing SRPM \`$SRPM_PATH'."" "$"Aborting..." >&2 - exit 255 - fi - - tmpfile=`mktemp -q -t $me.XXXXXXXX` || { - echo "$me: "$"error: cannot create temporary files; aborting." - exit 255 - } - - tmpdir=`mktemp -d -q -t $me.XXXXXXXX` || { - echo "$me: "$"error: cannot create temporary directory; aborting." - exit 255 - } - - # get license agreement - ( rpm2cpio $SRPM_PATH > $tmpfile && - cd $tmpdir && - cpio --quiet --extract --make-directories < $tmpfile ) 2>/dev/null - - if [ -f $tmpdir/LICENSE ]; then + if [ -f ${SRPM_PATH}/LICENSE ]; then if [ "$DISPLAY" ]; then - license-dialog $tmpdir/LICENSE + license-dialog ${SRPM_PATH}/LICENSE [ $? -ne 0 ] && exit 1 else echo $"You must accept the following license terms:" echo - more $tmpdir/LICENSE + more ${SRPM_PATH}/LICENSE echo -n $"Do you agree with the above license terms [y/N]? " read ans [ "$ans" = "Y" -o "$ans" = "y" ] || exit 1 @@ -122,10 +100,28 @@ for pckname in $PACKAGES; do notify-send -a $"Network software installation" -i $icon "$pckname" $"$pckname installation in progress..." # build rpm - echo "$me: "$"rebuilding package \`$SRPM_PATH'..." - rpmbuild --rebuild $SRPM_PATH --define="%_rpmdir $tmpdir" + tmpfile=`mktemp -q -t $me.XXXXXXXX` || { + echo "$me: "$"error: cannot create temporary files; aborting." + exit 255 + } + + tmpdir=`mktemp -d -q -t $me.XXXXXXXX` || { + echo "$me: "$"error: cannot create temporary directory; aborting." + exit 255 + } + + echo "$me: "$"rebuilding package \`$pckname'..." + + sed "s|@SRPMVERSION@|${SRPMVERSION[${pckname}]}|g;s|@SRPMRELEASE@|${SRPMRELEASE[${pckname}]}|g" \ + ${SPEC_PATHNAME} >> $tmpfile + + rpmbuild --ba \ + --define="%_rpmdir $tmpdir" \ + --define="%_sourcedir ${SRPM_PATH}" \ + $tmpfile + if [ $? -gt 0 ]; then - echo "$me: "$"error rebuilding \`$SRPM_PATH'."" "$"Aborting..." >&2 + echo "$me: "$"error rebuilding \`$pckname'."" "$"Aborting..." >&2 notify-send -a $"Network software installation" -i $icon "$pckname" $"There was an error installing"" $pckname!" exit 255 fi