| Index: chrome_linux/installer/rpm/chrome.spec.template
|
| ===================================================================
|
| --- chrome_linux/installer/rpm/chrome.spec.template (revision 0)
|
| +++ chrome_linux/installer/rpm/chrome.spec.template (revision 0)
|
| @@ -0,0 +1,204 @@
|
| +#------------------------------------------------------------------------------
|
| +# chrome.spec
|
| +#------------------------------------------------------------------------------
|
| +
|
| +#------------------------------------------------------------------------------
|
| +# Prologue information
|
| +#------------------------------------------------------------------------------
|
| +Summary : @@MENUNAME@@
|
| +License : Multiple, see @@PRODUCTURL@@
|
| +Name : @@PACKAGE@@-@@CHANNEL@@
|
| +Version : @@VERSION@@
|
| +Release : @@PACKAGE_RELEASE@@
|
| +Group : Applications/Internet
|
| +Vendor : @@COMPANY_FULLNAME@@
|
| +Url : @@PRODUCTURL@@
|
| +Packager : @@MAINTNAME@@ <@@MAINTMAIL@@>
|
| +
|
| +Provides : @@PROVIDES@@ = %{version}
|
| +Requires : @@DEPENDS@@
|
| +Autoreqprov : No
|
| +Conflicts : @@REPLACES@@
|
| +
|
| +BuildRoot : %{_tmppath}/%{name}-%{version}-root
|
| +
|
| +# The prefix is pretty important; RPM uses this to figure out
|
| +# how to make a package relocatable
|
| +prefix : /opt
|
| +
|
| +#------------------------------------------------------------------------------
|
| +# Description
|
| +#------------------------------------------------------------------------------
|
| +%Description
|
| +@@SHORTDESC@@
|
| +
|
| +@@FULLDESC@@
|
| +
|
| +#------------------------------------------------------------------------------
|
| +# Build rule - How to make the package
|
| +#------------------------------------------------------------------------------
|
| +%build
|
| +
|
| +#------------------------------------------------------------------------------
|
| +# Installation rule - how to install it (note that it
|
| +# gets installed into a temp directory given by $RPM_BUILD_ROOT)
|
| +#------------------------------------------------------------------------------
|
| +%install
|
| +rm -rf "$RPM_BUILD_ROOT"
|
| +
|
| +if [ -z "@@STAGEDIR@@" -o ! -d "@@STAGEDIR@@" ] ; then
|
| + echo "@@STAGEDIR@@ appears to be incorrectly set - aborting"
|
| + exit 1
|
| +fi
|
| +
|
| +if [ -z "@@INSTALLDIR@@" -o ! -d "@@STAGEDIR@@/@@INSTALLDIR@@" ] ; then
|
| + echo "@@INSTALLDIR@@ appears to be incorrectly set - aborting"
|
| + exit 1
|
| +fi
|
| +
|
| +install -m 755 -d \
|
| + "$RPM_BUILD_ROOT/etc" \
|
| + "$RPM_BUILD_ROOT/opt" \
|
| + "$RPM_BUILD_ROOT/usr"
|
| +# This is hard coded for now
|
| +cp -a "@@STAGEDIR@@/etc/" "$RPM_BUILD_ROOT/"
|
| +cp -a "@@STAGEDIR@@/opt/" "$RPM_BUILD_ROOT/"
|
| +cp -a "@@STAGEDIR@@/usr/" "$RPM_BUILD_ROOT/"
|
| +
|
| +#------------------------------------------------------------------------------
|
| +# Rule to clean up a build
|
| +#------------------------------------------------------------------------------
|
| +%clean
|
| +rm -rf "$RPM_BUILD_ROOT"
|
| +
|
| +#------------------------------------------------------------------------------
|
| +# Files listing.
|
| +#------------------------------------------------------------------------------
|
| +%files
|
| +%defattr(-,root,root)
|
| +#%doc README
|
| +
|
| +# We cheat and just let RPM figure it out for us; everything we install
|
| +# should go under this prefix anyways.
|
| +@@INSTALLDIR@@
|
| +
|
| +# Be explicit about the files we scatter throughout the system we don't
|
| +# accidentally "own" stuff that's not ours (crbug.com/123990).
|
| +/etc/cron.daily/@@PACKAGE_FILENAME@@
|
| +/usr/bin/@@PACKAGE_FILENAME@@
|
| +/usr/share/gnome-control-center/default-apps/@@PACKAGE_FILENAME@@.xml
|
| +%docdir /usr/share/man/man1
|
| +/usr/share/man/man1/@@PACKAGE_FILENAME@@.1
|
| +
|
| +#------------------------------------------------------------------------------
|
| +# Pre install script
|
| +#------------------------------------------------------------------------------
|
| +%pre
|
| +
|
| +exit 0
|
| +
|
| +
|
| +
|
| +
|
| +#------------------------------------------------------------------------------
|
| +# Post install script
|
| +#------------------------------------------------------------------------------
|
| +%post
|
| +
|
| +@@include@@../common/postinst.include
|
| +
|
| +@@include@@../common/rpm.include
|
| +
|
| +@@include@@../common/symlinks.include
|
| +
|
| +remove_nss_symlinks
|
| +add_nss_symlinks
|
| +
|
| +remove_udev_symlinks
|
| +add_udev_symlinks
|
| +
|
| +DEFAULTS_FILE="/etc/default/@@PACKAGE@@"
|
| +if [ ! -e "$DEFAULTS_FILE" ]; then
|
| + echo 'repo_add_once="true"' > "$DEFAULTS_FILE"
|
| +fi
|
| +
|
| +. "$DEFAULTS_FILE"
|
| +
|
| +if [ "$repo_add_once" = "true" ]; then
|
| + determine_rpm_package_manager
|
| +
|
| + case $PACKAGEMANAGER in
|
| + "yum")
|
| + install_yum
|
| + ;;
|
| + "urpmi")
|
| + install_urpmi
|
| + ;;
|
| + "yast")
|
| + install_yast
|
| + ;;
|
| + esac
|
| +fi
|
| +
|
| +# Some package managers have locks that prevent everything from being
|
| +# configured at install time, so wait a bit then kick the cron job to do
|
| +# whatever is left. Probably the db will be unlocked by then, but if not, the
|
| +# cron job will keep retrying.
|
| +# Do this with 'at' instead of a backgrounded shell because zypper waits on all
|
| +# sub-shells to finish before it finishes, which is exactly the opposite of
|
| +# what we want here. Also preemptively start atd because for some reason it's
|
| +# not always running, which kind of defeats the purpose of having 'at' as a
|
| +# required LSB command.
|
| +service atd start
|
| +echo "sh /etc/cron.daily/@@PACKAGE@@" | at now + 2 minute > /dev/null 2>&1
|
| +exit 0
|
| +
|
| +
|
| +#------------------------------------------------------------------------------
|
| +# Pre uninstallation script
|
| +#------------------------------------------------------------------------------
|
| +%preun
|
| +
|
| +if [ "$1" -eq "0" ]; then
|
| + mode="uninstall"
|
| +elif [ "$1" -eq "1" ]; then
|
| + mode="upgrade"
|
| +fi
|
| +
|
| +@@include@@../common/rpm.include
|
| +
|
| +@@include@@../common/symlinks.include
|
| +
|
| +# Only remove menu items and symlinks on uninstall. When upgrading,
|
| +# old_pkg's %preun runs after new_pkg's %post.
|
| +if [ "$mode" = "uninstall" ]; then
|
| +@@include@@../common/prerm.include
|
| + remove_nss_symlinks
|
| + remove_udev_symlinks
|
| +fi
|
| +
|
| +# On Debian we only remove when we purge. However, RPM has no equivalent to
|
| +# dpkg --purge, so this is all disabled.
|
| +#
|
| +#determine_rpm_package_manager
|
| +#
|
| +#case $PACKAGEMANAGER in
|
| +#"yum")
|
| +# remove_yum
|
| +# ;;
|
| +#"urpmi")
|
| +# remove_urpmi
|
| +# ;;
|
| +#"yast")
|
| +# remove_yast
|
| +# ;;
|
| +#esac
|
| +
|
| +exit 0
|
| +
|
| +#------------------------------------------------------------------------------
|
| +# Post uninstallation script
|
| +#------------------------------------------------------------------------------
|
| +%postun
|
| +
|
| +exit 0
|
|
|