netsrpms: some rework to build from specfile instead of srpm to let user do version changes on his own

flashplugin update to 11.2.202.394
skype update to 4.3.0.37
This commit is contained in:
Silvan Calarco 2014-07-24 13:21:02 +02:00
parent 2b4a063515
commit 17d323c6e2
12 changed files with 73 additions and 70 deletions

View File

@ -1,5 +1,5 @@
# Makefile for desktop-base-openmamba package # Makefile for desktop-base-openmamba package
# Copyright (C) 2004-2013 by Silvan Calarco <silvan.calarco@mambasoft.it> # Copyright (C) 2004-2014 by Silvan Calarco <silvan.calarco@mambasoft.it>
# Copyright (C) 2005-2007 by Davide Madrisan <davide.madrisan@gmail.com> # Copyright (C) 2005-2007 by Davide Madrisan <davide.madrisan@gmail.com>
include VERSION include VERSION
@ -121,13 +121,7 @@ pck_catalogs3 := $(wildcard openmamba-update/po/*.po)
s,@distrodesktopdir@,$(distrodesktopdir),g;\ s,@distrodesktopdir@,$(distrodesktopdir),g;\
s,@distrosrpmsdir@,$(distrosrpmsdir),g;\ s,@distrosrpmsdir@,$(distrosrpmsdir),g;\
s,@wallpaper@,$(DEFAULT_WALLPAPER),g;\ s,@wallpaper@,$(DEFAULT_WALLPAPER),g;\
s,@screensaver@,${SCREENSAVER},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" $< > $@
all: dist-update locales all: dist-update locales
@ -224,9 +218,9 @@ install-srpms:
@$(INSTALL_DIR) $(DESTDIR)$(sysconfigdir) @$(INSTALL_DIR) $(DESTDIR)$(sysconfigdir)
@cat $(SRPMSVERSIONSFILE) > $(DESTDIR)$(sysconfigdir)/$(SYSCONFIGFILE) @cat $(SRPMSVERSIONSFILE) > $(DESTDIR)$(sysconfigdir)/$(SYSCONFIGFILE)
for pck in $(pck_srpms); do\ for pck in $(pck_srpms); do\
rpmbuild -bs SRPMS/$$pck/$${pck}.spec \ cp -a SRPMS/$$pck $(DESTDIR)$(distrosrpmsdir); \
--define="_sourcedir `pwd`/SRPMS/$$pck" \ rm -f $(DESTDIR)$(distrosrpmsdir)/$$pck/distroutils.sysconfig*; \
--define="_srcrpmdir $(DESTDIR)$(distrosrpmsdir)" || exit 1;\ rm -f $(DESTDIR)$(distrosrpmsdir)/$$pck/*.spec.in; \
cat SRPMS/$$pck/$(pck_sysconfigfile) >> \ cat SRPMS/$$pck/$(pck_sysconfigfile) >> \
$(DESTDIR)$(sysconfigdir)/$(SYSCONFIGFILE);\ $(DESTDIR)$(sysconfigdir)/$(SYSCONFIGFILE);\
done done

View File

@ -4,4 +4,4 @@
FLASH_PLUGIN_PCK=install_flash_player_11_linux.@arch@.tar.gz FLASH_PLUGIN_PCK=install_flash_player_11_linux.@arch@.tar.gz
# package URL (do not modify unless you know what you're doing) # 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"]}/

View File

@ -1,6 +1,6 @@
Name: flashplugin Name: flashplugin
Version: @flashpluginver@ Version: @SRPMVERSION@
Release: 1@distroext@ Release: @SRPMRELEASE@
Epoch: 1 Epoch: 1
Summary: Macromedia Flash plugin for web browsers Summary: Macromedia Flash plugin for web browsers
Group: Applications/Web Group: Applications/Web
@ -24,6 +24,7 @@ Macromedia Flash plugin for web browsers.
%setup -c -n %{name}-%{version} -D -T %setup -c -n %{name}-%{version} -D -T
[ -r /etc/sysconfig/@sysconfigfile@ ] || exit 1 [ -r /etc/sysconfig/@sysconfigfile@ ] || exit 1
declare -A SRPMVERSION SRPMRELEASE
. /etc/sysconfig/@sysconfigfile@ . /etc/sysconfig/@sysconfigfile@
[ "${FLASH_PLUGIN_PCK}" ] || exit 1 [ "${FLASH_PLUGIN_PCK}" ] || exit 1

View File

@ -1,6 +1,6 @@
Name: skype Name: skype
Version: @skypever@ Version: @SRPMVERSION@
Release: @distroext@ Release: @SRPMRELEASE@
Epoch: 1 Epoch: 1
Summary: An Internet voice and video communication software Summary: An Internet voice and video communication software
Group: Graphical Desktop/Applications/Internet Group: Graphical Desktop/Applications/Internet

View File

@ -1,7 +1,7 @@
#% define spotify_make_ver 20130831git #% define spotify_make_ver 20130831git
Name: spotify Name: spotify
Version: @spotifyver@ Version: @SRPMVERSION@
Release: 1mamba Release: @SRPMRELEASE@
Summary: Listen to music using Spotify Summary: Listen to music using Spotify
Group: Graphical Desktop/Applications/Multimedia Group: Graphical Desktop/Applications/Multimedia
Vendor: @vendor@ Vendor: @vendor@

View File

@ -22,8 +22,8 @@
%define cgibindir %{_var}/www/cgi-bin %define cgibindir %{_var}/www/cgi-bin
Name: sun-java7 Name: sun-java7
Version: @sunjava7ver@ Version: @SRPMVERSION@
Release: 2@distroext@ Release: @SRPMRELEASE@
Epoch: 1 Epoch: 1
Summary: Sun Java Developer's Kit Summary: Sun Java Developer's Kit
Group: System/Libraries/Java Group: System/Libraries/Java

View File

@ -1,7 +1,7 @@
## VirtualBox Extension Pack ## VirtualBox Extension Pack
# package name (do not modify unless you know what you're doing) # 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) # 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"]}/

View File

@ -1,8 +1,8 @@
%define pck_majver %(echo %version | cut -d. -f1-3) %define pck_majver %(echo %version | cut -d. -f1-3)
%define pck_minver %(echo %version | cut -d. -f4) %define pck_minver %(echo %version | cut -d. -f4)
Name: virtualbox-extension-pack Name: virtualbox-extension-pack
Version: @virtualboxextensionpackver@ Version: @SRPMVERSION@
Release: 1@distroext@ Release: @SRPMRELEASE@
Epoch: 1 Epoch: 1
Summary: VirtualBox Extension Pack Summary: VirtualBox Extension Pack
Group: Applications/Emulators Group: Applications/Emulators

View File

@ -12,8 +12,8 @@
%define alt_url10 ftp://ftp10.mplayerhq.hu/MPlayer/releases/codecs/ %define alt_url10 ftp://ftp10.mplayerhq.hu/MPlayer/releases/codecs/
Name: win32codecs Name: win32codecs
Version: @win32codecsver@ Version: @SRPMVERSION@
Release: 1@distroext@ Release: @SRPMRELEASE@
Summary: Win32 native dll codecs Summary: Win32 native dll codecs
Group: System/Multimedia Group: System/Multimedia
Vendor: @vendor@ Vendor: @vendor@

View File

@ -1,6 +1,17 @@
FLASHPLUGIN_VERSION=11.2.202.336 SRPMVERSION["flashplugin"]=11.2.202.394
WIN32CODECS_VERSION=20110131 SRPMRELEASE["flashplugin"]=1mamba
SKYPE_VERSION=4.2.0.13
VIRTUALBOX_EXTENSION_PACK_VERSION=4.3.8 SRPMVERSION["win32codecs"]=20110131
SUN_JAVA7_VERSION=7u51 SRPMRELEASE["win32codecs"]=1mamba
SPOTIFY_VERSION=20140117
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

View File

@ -1 +1,2 @@
SUN_JAVA7_VERSION=7u51 SRPMVERSION["sun-java7"]=7u51
SRPMRELEASE["sun-java7"]=2mamba

View File

@ -43,22 +43,22 @@ function check_if_already_installed() {
fi fi
} }
declare -A SRPMVERSION SRPMRELEASE
. /etc/sysconfig/netsrpminstall || exit 1
for pckname in $PACKAGES; do for pckname in $PACKAGES; do
icon=`grep Icon= /usr/share/applications/openmamba-$pckname.desktop | sed "s|Icon=||"` icon=`grep Icon= /usr/share/applications/openmamba-$pckname.desktop | sed "s|Icon=||"`
SRPM_NAME=`\ SRPM_PATH=$DISTRO_SRPMS_DIR/${pckname}
find $DISTRO_SRPMS_DIR \ SPEC_PATHNAME=$SRPM_PATH/${pckname}.spec
-regex ".*/${pckname//+/\\+}-[^-]*-[^-]*" -printf "%f " 2>/dev/null`
[ "$SRPM_NAME" ] || { [ "$SPEC_PATHNAME" ] || {
echo $"$me: $pckname is missing in $DISTRO_SRPMS_DIR; aborting." echo $"$me: $pckname is missing in $DISTRO_SRPMS_DIR; aborting."
exit 255 exit 255
} }
SRPM_VERSION=`\ SPEC_VERSION=${SRPMVERSION[${pckname}]}-${SRPMRELEASE[${pckname}]}
echo $SRPM_NAME | \
sed "s|${pckname//+/\\+}-\([^-]*-[^-]*\).src.rpm|\1|" 2>/dev/null`
RPM_INSTALLED=`rpm -q $pckname` RPM_INSTALLED=`rpm -q $pckname`
[ $? -eq 0 ] || RPM_INSTALLED= [ $? -eq 0 ] || RPM_INSTALLED=
@ -69,10 +69,10 @@ for pckname in $PACKAGES; do
echo $"Package name: $pckname" echo $"Package name: $pckname"
echo $"Installed version: $RPM_INSTALLED_VERSION" echo $"Installed version: $RPM_INSTALLED_VERSION"
echo $"Last version: $SRPM_VERSION" echo $"Last version: $SPEC_VERSION"
echo echo
if [ "$RPM_INSTALLED_VERSION" != "$SRPM_VERSION" ]; then if [ "$RPM_INSTALLED_VERSION" != "$SPEC_VERSION" ]; then
if [ "$RPM_INSTALLED_VERSION" ]; then if [ "$RPM_INSTALLED_VERSION" ]; then
UPDATE_NEEDED=1 UPDATE_NEEDED=1
elif [ "$UPGRADE_MODE" ]; then elif [ "$UPGRADE_MODE" ]; then
@ -83,36 +83,14 @@ for pckname in $PACKAGES; do
fi fi
if [ ! "$CHECK_MODE" ]; then if [ ! "$CHECK_MODE" ]; then
SRPM_PATH=${DISTRO_SRPMS_DIR}/${SRPM_NAME} if [ -f ${SRPM_PATH}/LICENSE ]; then
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 [ "$DISPLAY" ]; then if [ "$DISPLAY" ]; then
license-dialog $tmpdir/LICENSE license-dialog ${SRPM_PATH}/LICENSE
[ $? -ne 0 ] && exit 1 [ $? -ne 0 ] && exit 1
else else
echo $"You must accept the following license terms:" echo $"You must accept the following license terms:"
echo echo
more $tmpdir/LICENSE more ${SRPM_PATH}/LICENSE
echo -n $"Do you agree with the above license terms [y/N]? " echo -n $"Do you agree with the above license terms [y/N]? "
read ans read ans
[ "$ans" = "Y" -o "$ans" = "y" ] || exit 1 [ "$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..." notify-send -a $"Network software installation" -i $icon "$pckname" $"$pckname installation in progress..."
# build rpm # build rpm
echo "$me: "$"rebuilding package \`$SRPM_PATH'..." tmpfile=`mktemp -q -t $me.XXXXXXXX` || {
rpmbuild --rebuild $SRPM_PATH --define="%_rpmdir $tmpdir" 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 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!" notify-send -a $"Network software installation" -i $icon "$pckname" $"There was an error installing"" $pckname!"
exit 255 exit 255
fi fi