chrome.spec.template revision eb525c5499e34cc9c4b825d6d9e75bb07cc06ace
1#------------------------------------------------------------------------------ 2# chrome.spec 3#------------------------------------------------------------------------------ 4 5#------------------------------------------------------------------------------ 6# Prologue information 7#------------------------------------------------------------------------------ 8Summary : @@MENUNAME@@ 9License : Multiple, see @@PRODUCTURL@@ 10Name : @@PACKAGE@@-@@CHANNEL@@ 11Version : @@VERSION@@ 12Release : @@PACKAGE_RELEASE@@ 13Group : Applications/Internet 14Vendor : @@COMPANY_FULLNAME@@ 15Url : @@PRODUCTURL@@ 16Packager : @@MAINTNAME@@ <@@MAINTMAIL@@> 17 18Provides : @@PROVIDES@@ = %{version} 19Requires : @@DEPENDS@@ 20Autoreqprov : No 21Conflicts : @@REPLACES@@ 22 23BuildRoot : %{_tmppath}/%{name}-%{version}-root 24 25# The prefix is pretty important; RPM uses this to figure out 26# how to make a package relocatable 27prefix : /opt 28 29#------------------------------------------------------------------------------ 30# Description 31#------------------------------------------------------------------------------ 32%Description 33@@SHORTDESC@@ 34 35@@FULLDESC@@ 36 37#------------------------------------------------------------------------------ 38# Build rule - How to make the package 39#------------------------------------------------------------------------------ 40%build 41 42#------------------------------------------------------------------------------ 43# Installation rule - how to install it (note that it 44# gets installed into a temp directory given by $RPM_BUILD_ROOT) 45#------------------------------------------------------------------------------ 46%install 47rm -rf "$RPM_BUILD_ROOT" 48 49if [ -z "@@STAGEDIR@@" -o ! -d "@@STAGEDIR@@" ] ; then 50 echo "@@STAGEDIR@@ appears to be incorrectly set - aborting" 51 exit 1 52fi 53 54if [ -z "@@INSTALLDIR@@" -o ! -d "@@STAGEDIR@@/@@INSTALLDIR@@" ] ; then 55 echo "@@INSTALLDIR@@ appears to be incorrectly set - aborting" 56 exit 1 57fi 58 59install -m 755 -d \ 60 "$RPM_BUILD_ROOT/etc" \ 61 "$RPM_BUILD_ROOT/opt" \ 62 "$RPM_BUILD_ROOT/usr" 63# This is hard coded for now 64cp -a "@@STAGEDIR@@/etc/" "$RPM_BUILD_ROOT/" 65cp -a "@@STAGEDIR@@/opt/" "$RPM_BUILD_ROOT/" 66cp -a "@@STAGEDIR@@/usr/" "$RPM_BUILD_ROOT/" 67 68#------------------------------------------------------------------------------ 69# Rule to clean up a build 70#------------------------------------------------------------------------------ 71%clean 72rm -rf "$RPM_BUILD_ROOT" 73 74#------------------------------------------------------------------------------ 75# Files listing. 76#------------------------------------------------------------------------------ 77%files 78%defattr(-,root,root) 79#%doc README 80 81# We cheat and just let RPM figure it out for us; everything we install 82# should go under this prefix anyways. 83@@INSTALLDIR@@ 84 85# Be explicit about the files we scatter throughout the system we don't 86# accidentally "own" stuff that's not ours (crbug.com/123990). 87/etc/cron.daily/@@PACKAGE_FILENAME@@ 88/usr/bin/@@PACKAGE_FILENAME@@ 89/usr/share/gnome-control-center/default-apps/@@PACKAGE_FILENAME@@.xml 90%docdir /usr/share/man/man1 91/usr/share/man/man1/@@PACKAGE_FILENAME@@.1 92 93#------------------------------------------------------------------------------ 94# Pre install script 95#------------------------------------------------------------------------------ 96%pre 97 98exit 0 99 100 101 102 103#------------------------------------------------------------------------------ 104# Post install script 105#------------------------------------------------------------------------------ 106%post 107 108@@include@@../common/postinst.include 109 110@@include@@../common/rpm.include 111 112@@include@@../common/symlinks.include 113 114remove_nss_symlinks 115add_nss_symlinks 116 117remove_udev_symlinks 118add_udev_symlinks 119 120DEFAULTS_FILE="/etc/default/@@PACKAGE@@" 121if [ ! -e "$DEFAULTS_FILE" ]; then 122 echo 'repo_add_once="true"' > "$DEFAULTS_FILE" 123fi 124 125. "$DEFAULTS_FILE" 126 127if [ "$repo_add_once" = "true" ]; then 128 determine_rpm_package_manager 129 130 case $PACKAGEMANAGER in 131 "yum") 132 install_yum 133 ;; 134 "urpmi") 135 install_urpmi 136 ;; 137 "yast") 138 install_yast 139 ;; 140 esac 141fi 142 143# Some package managers have locks that prevent everything from being 144# configured at install time, so wait a bit then kick the cron job to do 145# whatever is left. Probably the db will be unlocked by then, but if not, the 146# cron job will keep retrying. 147# Do this with 'at' instead of a backgrounded shell because zypper waits on all 148# sub-shells to finish before it finishes, which is exactly the opposite of 149# what we want here. Also preemptively start atd because for some reason it's 150# not always running, which kind of defeats the purpose of having 'at' as a 151# required LSB command. 152service atd start 153echo "sh /etc/cron.daily/@@PACKAGE@@" | at now + 2 minute > /dev/null 2>&1 154exit 0 155 156 157#------------------------------------------------------------------------------ 158# Pre uninstallation script 159#------------------------------------------------------------------------------ 160%preun 161 162if [ "$1" -eq "0" ]; then 163 mode="uninstall" 164elif [ "$1" -eq "1" ]; then 165 mode="upgrade" 166fi 167 168@@include@@../common/rpm.include 169 170@@include@@../common/symlinks.include 171 172# Only remove menu items and symlinks on uninstall. When upgrading, 173# old_pkg's %preun runs after new_pkg's %post. 174if [ "$mode" = "uninstall" ]; then 175@@include@@../common/prerm.include 176 remove_nss_symlinks 177 remove_udev_symlinks 178fi 179 180# On Debian we only remove when we purge. However, RPM has no equivalent to 181# dpkg --purge, so this is all disabled. 182# 183#determine_rpm_package_manager 184# 185#case $PACKAGEMANAGER in 186#"yum") 187# remove_yum 188# ;; 189#"urpmi") 190# remove_urpmi 191# ;; 192#"yast") 193# remove_yast 194# ;; 195#esac 196 197exit 0 198 199#------------------------------------------------------------------------------ 200# Post uninstallation script 201#------------------------------------------------------------------------------ 202%postun 203 204exit 0 205