1 #------------------------------------------------------------------------------
3 #------------------------------------------------------------------------------
5 #------------------------------------------------------------------------------
7 #------------------------------------------------------------------------------
9 License : Multiple, see @@PRODUCTURL@@
10 Name : @@PACKAGE@@-@@CHANNEL@@
12 Release : @@PACKAGE_RELEASE@@
13 Group : Applications/Internet
14 Vendor : @@COMPANY_FULLNAME@@
16 Packager : @@MAINTNAME@@ <@@MAINTMAIL@@>
18 Provides : @@PROVIDES@@ = %{version}
19 Requires : @@DEPENDS@@
20 Requires(post) : %{_sbindir}/update-alternatives
21 Requires(preun) : %{_sbindir}/update-alternatives
23 Conflicts : @@REPLACES@@
25 BuildRoot : %{_tmppath}/%{name}-%{version}-root
27 # The prefix is pretty important; RPM uses this to figure out
28 # how to make a package relocatable
31 #------------------------------------------------------------------------------
33 #------------------------------------------------------------------------------
39 #------------------------------------------------------------------------------
40 # Build rule - How to make the package
41 #------------------------------------------------------------------------------
44 #------------------------------------------------------------------------------
45 # Installation rule - how to install it (note that it
46 # gets installed into a temp directory given by $RPM_BUILD_ROOT)
47 #------------------------------------------------------------------------------
49 rm -rf "$RPM_BUILD_ROOT"
51 if [ -z "@@STAGEDIR@@" -o ! -d "@@STAGEDIR@@" ] ; then
52 echo "@@STAGEDIR@@ appears to be incorrectly set - aborting"
56 if [ -z "@@INSTALLDIR@@" -o ! -d "@@STAGEDIR@@/@@INSTALLDIR@@" ] ; then
57 echo "@@INSTALLDIR@@ appears to be incorrectly set - aborting"
62 "$RPM_BUILD_ROOT/etc" \
63 "$RPM_BUILD_ROOT/opt" \
65 # This is hard coded for now
66 cp -a "@@STAGEDIR@@/etc/" "$RPM_BUILD_ROOT/"
67 cp -a "@@STAGEDIR@@/opt/" "$RPM_BUILD_ROOT/"
68 cp -a "@@STAGEDIR@@/usr/" "$RPM_BUILD_ROOT/"
70 #------------------------------------------------------------------------------
71 # Rule to clean up a build
72 #------------------------------------------------------------------------------
74 rm -rf "$RPM_BUILD_ROOT"
76 #------------------------------------------------------------------------------
78 #------------------------------------------------------------------------------
83 # We cheat and just let RPM figure it out for us; everything we install
84 # should go under this prefix anyways.
87 # Be explicit about the files we scatter throughout the system we don't
88 # accidentally "own" stuff that's not ours (crbug.com/123990).
89 /etc/cron.daily/@@PACKAGE_FILENAME@@
90 %ghost %attr(755,root,root) /usr/bin/google-chrome
91 /usr/bin/@@USR_BIN_SYMLINK_NAME@@
92 /usr/share/applications/@@PACKAGE_FILENAME@@.desktop
93 /usr/share/gnome-control-center/default-apps/@@PACKAGE_FILENAME@@.xml
94 %docdir /usr/share/man/man1
95 /usr/share/man/man1/@@PACKAGE_FILENAME@@.1
97 #------------------------------------------------------------------------------
99 #------------------------------------------------------------------------------
107 #------------------------------------------------------------------------------
108 # Post install script
109 #------------------------------------------------------------------------------
112 @@include@@../common/postinst.include
114 @@include@@../common/rpm.include
116 @@include@@../common/symlinks.include
123 DEFAULTS_FILE="/etc/default/@@PACKAGE@@"
124 if [ ! -e "$DEFAULTS_FILE" ]; then
125 echo 'repo_add_once="true"' > "$DEFAULTS_FILE"
130 if [ "$repo_add_once" = "true" ]; then
131 determine_rpm_package_manager
133 case $PACKAGEMANAGER in
146 # Some package managers have locks that prevent everything from being
147 # configured at install time, so wait a bit then kick the cron job to do
148 # whatever is left. Probably the db will be unlocked by then, but if not, the
149 # cron job will keep retrying.
150 # Do this with 'at' instead of a backgrounded shell because zypper waits on all
151 # sub-shells to finish before it finishes, which is exactly the opposite of
152 # what we want here. Also preemptively start atd because for some reason it's
153 # not always running, which kind of defeats the purpose of having 'at' as a
154 # required LSB command.
156 echo "sh /etc/cron.daily/@@PACKAGE@@" | at now + 2 minute > /dev/null 2>&1
174 %{_sbindir}/update-alternatives --install /usr/bin/google-chrome google-chrome \
175 /usr/bin/@@USR_BIN_SYMLINK_NAME@@ $PRIORITY
180 #------------------------------------------------------------------------------
181 # Pre uninstallation script
182 #------------------------------------------------------------------------------
185 if [ "$1" -eq "0" ]; then
187 elif [ "$1" -eq "1" ]; then
191 @@include@@../common/rpm.include
193 @@include@@../common/symlinks.include
195 # Only remove menu items and symlinks on uninstall. When upgrading,
196 # old_pkg's %preun runs after new_pkg's %post.
197 if [ "$mode" = "uninstall" ]; then
198 @@include@@../common/prerm.include
202 %{_sbindir}/update-alternatives --remove google-chrome \
203 /usr/bin/@@USR_BIN_SYMLINK_NAME@@
206 # On Debian we only remove when we purge. However, RPM has no equivalent to
207 # dpkg --purge, so this is all disabled.
209 #determine_rpm_package_manager
211 #case $PACKAGEMANAGER in
225 #------------------------------------------------------------------------------
226 # Post uninstallation script
227 #------------------------------------------------------------------------------