VirtualBox

source: vbox/trunk/src/VBox/Installer/linux/rpm/VirtualBox.tmpl.spec@ 44940

Last change on this file since 44940 was 43768, checked in by vboxsync, 12 years ago

Installer/linux: attempt to fix the RPM spec file.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 16.1 KB
Line 
1#
2# Spec file for creating VirtualBox rpm packages
3#
4
5#
6# Copyright (C) 2006-2012 Oracle Corporation
7#
8# This file is part of VirtualBox Open Source Edition (OSE), as
9# available from http://www.virtualbox.org. This file is free software;
10# you can redistribute it and/or modify it under the terms of the GNU
11# General Public License (GPL) as published by the Free Software
12# Foundation, in version 2 as it comes in the "COPYING" file of the
13# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15#
16
17%define %SPEC% 1
18%define %OSE% 1
19%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
20
21Summary: Oracle VM VirtualBox
22Name: %NAME%
23Version: %BUILDVER%_%BUILDREL%
24Release: 1
25URL: http://www.virtualbox.org/
26Source: VirtualBox.tar.bz2
27License: GPLv2
28Group: Applications/System
29Vendor: Oracle Corporation
30BuildRoot: %BUILDROOT%
31Requires: %INITSCRIPTS% %LIBASOUND%
32
33%if %{?rpm_suse:1}%{!?rpm_suse:0}
34%debug_package
35%endif
36
37%MACROSPYTHON%
38
39
40%description
41VirtualBox is a powerful PC virtualization solution allowing
42you to run a wide range of PC operating systems on your Linux
43system. This includes Windows, Linux, FreeBSD, DOS, OpenBSD
44and others. VirtualBox comes with a broad feature set and
45excellent performance, making it the premier virtualization
46software solution on the market.
47
48
49%prep
50%setup -q
51DESTDIR=""
52unset DESTDIR
53
54
55%build
56
57
58%install
59# Mandriva: prevent replacing 'echo' by 'gprintf'
60export DONT_GPRINTIFY=1
61rm -rf $RPM_BUILD_ROOT
62install -m 755 -d $RPM_BUILD_ROOT/sbin
63install -m 755 -d $RPM_BUILD_ROOT%{_initrddir}
64install -m 755 -d $RPM_BUILD_ROOT/lib/modules
65install -m 755 -d $RPM_BUILD_ROOT/etc/vbox
66install -m 755 -d $RPM_BUILD_ROOT/usr/bin
67install -m 755 -d $RPM_BUILD_ROOT/usr/src
68install -m 755 -d $RPM_BUILD_ROOT/usr/share/applications
69install -m 755 -d $RPM_BUILD_ROOT/usr/share/pixmaps
70install -m 755 -d $RPM_BUILD_ROOT/usr/share/icons/hicolor
71install -m 755 -d $RPM_BUILD_ROOT%{_defaultdocdir}/virtualbox
72install -m 755 -d $RPM_BUILD_ROOT/usr/lib/virtualbox
73install -m 755 -d $RPM_BUILD_ROOT/usr/lib/virtualbox/ExtensionPacks
74install -m 755 -d $RPM_BUILD_ROOT/usr/share/virtualbox
75install -m 755 -d $RPM_BUILD_ROOT/usr/share/mime/packages
76mv VBoxEFI32.fd $RPM_BUILD_ROOT/usr/lib/virtualbox || true
77mv VBoxEFI64.fd $RPM_BUILD_ROOT/usr/lib/virtualbox || true
78mv *.gc $RPM_BUILD_ROOT/usr/lib/virtualbox
79mv *.r0 $RPM_BUILD_ROOT/usr/lib/virtualbox
80mv *.rel $RPM_BUILD_ROOT/usr/lib/virtualbox || true
81mv VBoxNetDHCP $RPM_BUILD_ROOT/usr/lib/virtualbox
82mv VBoxNetAdpCtl $RPM_BUILD_ROOT/usr/lib/virtualbox
83if [ -f VBoxVolInfo ]; then
84 mv VBoxVolInfo $RPM_BUILD_ROOT/usr/lib/virtualbox
85fi
86mv VBoxXPCOMIPCD $RPM_BUILD_ROOT/usr/lib/virtualbox
87mv components $RPM_BUILD_ROOT/usr/lib/virtualbox/components
88mv *.so $RPM_BUILD_ROOT/usr/lib/virtualbox
89mv *.so.4 $RPM_BUILD_ROOT/usr/lib/virtualbox || true
90mv VBoxTestOGL $RPM_BUILD_ROOT/usr/lib/virtualbox
91mv vboxshell.py $RPM_BUILD_ROOT/usr/lib/virtualbox
92(export VBOX_INSTALL_PATH=/usr/lib/virtualbox && \
93 cd ./sdk/installer && \
94 %{__python} ./vboxapisetup.py install --prefix %{_prefix} --root $RPM_BUILD_ROOT)
95rm -rf sdk/installer
96mv sdk $RPM_BUILD_ROOT/usr/lib/virtualbox
97mv nls $RPM_BUILD_ROOT/usr/share/virtualbox
98cp -a src $RPM_BUILD_ROOT/usr/share/virtualbox
99mv VBox.sh $RPM_BUILD_ROOT/usr/bin/VBox
100mv VBoxSysInfo.sh $RPM_BUILD_ROOT/usr/share/virtualbox
101mv VBoxCreateUSBNode.sh $RPM_BUILD_ROOT/usr/share/virtualbox
102cp icons/128x128/virtualbox.png $RPM_BUILD_ROOT/usr/share/pixmaps/virtualbox.png
103cd icons
104 for i in *; do
105 if [ -f $i/virtualbox.png ]; then
106 install -d $RPM_BUILD_ROOT/usr/share/icons/hicolor/$i/apps
107 mv $i/virtualbox.png $RPM_BUILD_ROOT/usr/share/icons/hicolor/$i/apps
108 fi
109 install -d $RPM_BUILD_ROOT/usr/share/icons/hicolor/$i/mimetypes
110 mv $i/* $RPM_BUILD_ROOT/usr/share/icons/hicolor/$i/mimetypes || true
111 rmdir $i
112 done
113cd -
114rmdir icons
115mv virtualbox.xml $RPM_BUILD_ROOT/usr/share/mime/packages
116for i in VBoxManage VBoxSVC VBoxSDL VirtualBox VBoxHeadless VBoxExtPackHelperApp VBoxBalloonCtrl VBoxAutostart; do
117 mv $i $RPM_BUILD_ROOT/usr/lib/virtualbox; done
118if %WEBSVC%; then
119 for i in vboxwebsrv webtest; do
120 mv $i $RPM_BUILD_ROOT/usr/lib/virtualbox; done
121fi
122for i in VBoxSDL VirtualBox VBoxHeadless VBoxNetDHCP VBoxNetAdpCtl; do
123 chmod 4511 $RPM_BUILD_ROOT/usr/lib/virtualbox/$i; done
124if [ -f $RPM_BUILD_ROOT/usr/lib/virtualbox/VBoxVolInfo ]; then
125 chmod 4511 $RPM_BUILD_ROOT/usr/lib/virtualbox/VBoxVolInfo
126fi
127if [ -d ExtensionPacks/VNC ]; then
128 mv ExtensionPacks/VNC $RPM_BUILD_ROOT/usr/lib/virtualbox/ExtensionPacks
129fi
130mv VBoxTunctl $RPM_BUILD_ROOT/usr/bin
131%if %{?is_ose:0}%{!?is_ose:1}
132for d in /lib/modules/*; do
133 if [ -L $d/build ]; then
134 rm -f /tmp/vboxdrv-Module.symvers
135 ./src/vboxhost/build_in_tmp \
136 --save-module-symvers /tmp/vboxdrv-Module.symvers \
137 --module-source `pwd`/src/vboxhost/vboxdrv \
138 KBUILD_VERBOSE= KERN_DIR=$d/build MODULE_DIR=$RPM_BUILD_ROOT/$d/misc -j4 \
139 %INSTMOD%
140 ./src/vboxhost/build_in_tmp \
141 --use-module-symvers /tmp/vboxdrv-Module.symvers \
142 --module-source `pwd`/src/vboxhost/vboxnetflt \
143 KBUILD_VERBOSE= KERN_DIR=$d/build MODULE_DIR=$RPM_BUILD_ROOT/$d/misc -j4 \
144 %INSTMOD%
145 ./src/vboxhost/build_in_tmp \
146 --use-module-symvers /tmp/vboxdrv-Module.symvers \
147 --module-source `pwd`/src/vboxhost/vboxnetadp \
148 KBUILD_VERBOSE= KERN_DIR=$d/build MODULE_DIR=$RPM_BUILD_ROOT/$d/misc -j4 \
149 %INSTMOD%
150 ./src/vboxhost/build_in_tmp \
151 --use-module-symvers /tmp/vboxdrv-Module.symvers \
152 --module-source `pwd`/src/vboxhost/vboxpci \
153 KBUILD_VERBOSE= KERN_DIR=$d/build MODULE_DIR=$RPM_BUILD_ROOT/$d/misc -j4 \
154 %INSTMOD%
155 fi
156done
157%endif
158%if %{?is_ose:0}%{!?is_ose:1}
159 mv kchmviewer $RPM_BUILD_ROOT/usr/lib/virtualbox
160 for i in rdesktop-vrdp.tar.gz rdesktop-vrdp-keymaps; do
161 mv $i $RPM_BUILD_ROOT/usr/share/virtualbox; done
162 mv rdesktop-vrdp $RPM_BUILD_ROOT/usr/bin
163%endif
164for i in additions/VBoxGuestAdditions.iso; do
165 mv $i $RPM_BUILD_ROOT/usr/share/virtualbox; done
166if [ -d accessible ]; then
167 mv accessible $RPM_BUILD_ROOT/usr/lib/virtualbox
168fi
169install -D -m 755 vboxdrv.init $RPM_BUILD_ROOT%{_initrddir}/vboxdrv
170%if %{?rpm_suse:1}%{!?rpm_suse:0}
171ln -sf ../etc/init.d/vboxdrv $RPM_BUILD_ROOT/sbin/rcvboxdrv
172%endif
173install -D -m 755 vboxballoonctrl-service.init $RPM_BUILD_ROOT%{_initrddir}/vboxballoonctrl-service
174install -D -m 755 vboxautostart-service.init $RPM_BUILD_ROOT%{_initrddir}/vboxautostart-service
175install -D -m 755 vboxweb-service.init $RPM_BUILD_ROOT%{_initrddir}/vboxweb-service
176%if %{?rpm_suse:1}%{!?rpm_suse:0}
177ln -sf ../etc/init.d/vboxballoonctrl-service $RPM_BUILD_ROOT/sbin/rcvboxballoonctrl-service
178ln -sf ../etc/init.d/vboxautostart-service $RPM_BUILD_ROOT/sbin/rcvboxautostart-service
179ln -sf ../etc/init.d/vboxweb-service $RPM_BUILD_ROOT/sbin/rcvboxweb-service
180%endif
181ln -s VBox $RPM_BUILD_ROOT/usr/bin/VirtualBox
182ln -s VBox $RPM_BUILD_ROOT/usr/bin/virtualbox
183ln -s VBox $RPM_BUILD_ROOT/usr/bin/VBoxManage
184ln -s VBox $RPM_BUILD_ROOT/usr/bin/vboxmanage
185ln -s VBox $RPM_BUILD_ROOT/usr/bin/VBoxSDL
186ln -s VBox $RPM_BUILD_ROOT/usr/bin/vboxsdl
187ln -s VBox $RPM_BUILD_ROOT/usr/bin/VBoxVRDP
188ln -s VBox $RPM_BUILD_ROOT/usr/bin/VBoxHeadless
189ln -s VBox $RPM_BUILD_ROOT/usr/bin/vboxheadless
190ln -s VBox $RPM_BUILD_ROOT/usr/bin/VBoxBalloonCtrl
191ln -s VBox $RPM_BUILD_ROOT/usr/bin/vboxballoonctrl
192ln -s VBox $RPM_BUILD_ROOT/usr/bin/VBoxAutostart
193ln -s VBox $RPM_BUILD_ROOT/usr/bin/vboxautostart
194ln -s VBox $RPM_BUILD_ROOT/usr/bin/vboxwebsrv
195ln -s /usr/share/virtualbox/src/vboxhost $RPM_BUILD_ROOT/usr/src/vboxhost-%VER%
196mv virtualbox.desktop $RPM_BUILD_ROOT/usr/share/applications/virtualbox.desktop
197mv VBox.png $RPM_BUILD_ROOT/usr/share/pixmaps/VBox.png
198
199
200%pre
201# defaults
202[ -r /etc/default/virtualbox ] && . /etc/default/virtualbox
203
204# check for active VMs of the installed (old) package
205VBOXSVC_PID=`pidof VBoxSVC 2>/dev/null || true`
206if [ -n "$VBOXSVC_PID" ]; then
207 # executed before the new package is installed!
208 if [ -f /etc/init.d/vboxballoonctrl-service ]; then
209 # try graceful termination; terminate the balloon control service first
210 /etc/init.d/vboxballoonctrl-service stop 2>/dev/null || true
211 fi
212 if [ -f /etc/init.d/vboxautostart-service ]; then
213 # try graceful termination; terminate the autostart service first
214 /etc/init.d/vboxautostart-service stop 2>/dev/null || true
215 fi
216 if [ -f /etc/init.d/vboxweb-service ]; then
217 # try graceful termination; terminate the webservice first
218 /etc/init.d/vboxweb-service stop 2>/dev/null || true
219 fi
220 # ask the daemon to terminate immediately
221 kill -USR1 $VBOXSVC_PID
222 sleep 1
223 if pidof VBoxSVC > /dev/null 2>&1; then
224 echo "A copy of VirtualBox is currently running. Please close it and try again."
225 echo "Please note that it can take up to ten seconds for VirtualBox (in particular"
226 echo "the VBoxSVC daemon) to finish running."
227 exit 1
228 fi
229fi
230
231# check for old installation
232if [ -r /etc/vbox/vbox.cfg ]; then
233 . /etc/vbox/vbox.cfg
234 if [ "x$INSTALL_DIR" != "x" -a -d "$INSTALL_DIR" ]; then
235 echo "An old installation of VirtualBox was found. To install this package the"
236 echo "old package has to be removed first. Have a look at /etc/vbox/vbox.cfg to"
237 echo "determine the installation directory of the previous installation. After"
238 echo "uninstalling the old package remove the file /etc/vbox/vbox.cfg."
239 exit 1
240 fi
241fi
242
243# XXX remove old modules from previous versions (disable with INSTALL_NO_VBOXDRV=1 in /etc/default/virtualbox)
244if [ "$INSTALL_NO_VBOXDRV" != "1" ]; then
245 find /lib/modules -name "vboxdrv\.*" 2>/dev/null|xargs rm -f 2> /dev/null || true
246 find /lib/modules -name "vboxnetflt\.*" 2>/dev/null|xargs rm -f 2> /dev/null || true
247 find /lib/modules -name "vboxnetadp\.*" 2>/dev/null|xargs rm -f 2> /dev/null || true
248 find /lib/modules -name "vboxpci\.*" 2>/dev/null|xargs rm -f 2> /dev/null || true
249fi
250
251
252%post
253#include installer-common.sh
254
255LOG="/var/log/vbox-install.log"
256
257# defaults
258[ -r /etc/default/virtualbox ] && . /etc/default/virtualbox
259
260# remove old cruft
261if [ -f /etc/init.d/vboxdrv.sh ]; then
262 echo "Found old version of /etc/init.d/vboxdrv.sh, removing."
263 rm /etc/init.d/vboxdrv.sh
264fi
265if [ -f /etc/vbox/vbox.cfg ]; then
266 echo "Found old version of /etc/vbox/vbox.cfg, removing."
267 rm /etc/vbox/vbox.cfg
268fi
269rm -f /etc/vbox/module_not_compiled
270
271# XXX SELinux: allow text relocation entries
272%if %{?rpm_redhat:1}%{!?rpm_redhat:0}
273set_selinux_permissions /usr/lib/virtualbox /usr/share/virtualbox
274%endif
275
276# create users groups (disable with INSTALL_NO_GROUP=1 in /etc/default/virtualbox)
277if [ "$INSTALL_NO_GROUP" != "1" ]; then
278 echo
279 echo "Creating group 'vboxusers'. VM users must be member of that group!"
280 echo
281 groupadd -f vboxusers 2> /dev/null
282fi
283
284# install udev rule (disable with INSTALL_NO_UDEV=1 in /etc/default/virtualbox)
285# and /dev/vboxdrv and /dev/vboxusb/*/* device nodes
286install_device_node_setup root 0600 /usr/share/virtualbox "${usb_group}"
287%if %{?rpm_redhat:1}%{!?rpm_redhat:0}
288/sbin/chkconfig --add vboxdrv
289/sbin/chkconfig --add vboxballoonctrl-service
290/sbin/chkconfig --add vboxautostart-service
291/sbin/chkconfig --add vboxweb-service
292%endif
293%if %{?rpm_suse:1}%{!?rpm_suse:0}
294%{fillup_and_insserv -f -y -Y vboxdrv vboxballoonctrl-service vboxautostart-service vboxweb-service}
295%endif
296%if %{?rpm_mdv:1}%{!?rpm_mdv:0}
297/sbin/ldconfig
298%_post_service vboxdrv
299%_post_service vboxballoonctrl-service
300%_post_service vboxautostart-service
301%_post_service vboxweb-service
302%update_menus
303%endif
304update-mime-database /usr/share/mime &> /dev/null || :
305update-desktop-database -q > /dev/null 2>&1 || :
306touch --no-create /usr/share/icons/hicolor
307gtk-update-icon-cache -q /usr/share/icons/hicolor 2> /dev/null || :
308
309# Disable module compilation with INSTALL_NO_VBOXDRV=1 in /etc/default/virtualbox
310BUILD_MODULES=0
311REGISTER_MODULES=1
312if [ ! -f /lib/modules/`uname -r`/misc/vboxdrv.ko ]; then
313 REGISTER_MODULES=0
314 if [ "$INSTALL_NO_VBOXDRV" != "1" ]; then
315 # compile problem
316 cat << EOF
317No precompiled module for this kernel found -- trying to build one. Messages
318emitted during module compilation will be logged to $LOG.
319
320EOF
321 BUILD_MODULES=1
322 fi
323fi
324# if INSTALL_NO_VBOXDRV is set to 1, remove all shipped modules
325if [ "$INSTALL_NO_VBOXDRV" = "1" ]; then
326 rm -f /lib/modules/*/misc/vboxdrv.ko
327 rm -f /lib/modules/*/misc/vboxnetflt.ko
328 rm -f /lib/modules/*/misc/vboxnetadp.ko
329 rm -f /lib/modules/*/misc/vboxpci.ko
330fi
331if [ $BUILD_MODULES -eq 1 ]; then
332 /etc/init.d/vboxdrv setup || true
333else
334 if lsmod | grep -q "vboxdrv[^_-]"; then
335 /etc/init.d/vboxdrv stop || true
336 fi
337 if [ $REGISTER_MODULES -eq 1 ]; then
338 DKMS=`which dkms 2>/dev/null`
339 if [ -n "$DKMS" ]; then
340 $DKMS remove -m vboxhost -v %VER% --all > /dev/null 2>&1 || true
341 fi
342 fi
343 /etc/init.d/vboxdrv start > /dev/null
344fi
345/etc/init.d/vboxballoonctrl-service start > /dev/null
346/etc/init.d/vboxautostart-service start > /dev/null
347/etc/init.d/vboxweb-service start > /dev/null
348
349
350%preun
351# $1==0: remove the last version of the package
352# $1==1: install the first time
353# $1>=2: upgrade
354%if %{?rpm_suse:1}%{!?rpm_suse:0}
355%stop_on_removal vboxballoonctrl-service
356%stop_on_removal vboxautostart-service
357%stop_on_removal vboxweb-service
358%endif
359%if %{?rpm_mdv:1}%{!?rpm_mdv:0}
360%_preun_service vboxballoonctrl-service
361%_preun_service vboxautostart-service
362%_preun_service vboxweb-service
363%endif
364%if %{?rpm_redhat:1}%{!?rpm_redhat:0}
365if [ "$1" = 0 ]; then
366 /sbin/service vboxballoonctrl-service stop > /dev/null
367 /sbin/chkconfig --del vboxballoonctrl-service
368 /sbin/service vboxautostart-service stop > /dev/null
369 /sbin/chkconfig --del vboxautostart-service
370 /sbin/service vboxweb-service stop > /dev/null
371 /sbin/chkconfig --del vboxweb-service
372fi
373%endif
374
375if [ "$1" = 0 ]; then
376 # check for active VMs
377 VBOXSVC_PID=`pidof VBoxSVC 2>/dev/null || true`
378 if [ -n "$VBOXSVC_PID" ]; then
379 kill -USR1 $VBOXSVC_PID
380 sleep 1
381 if pidof VBoxSVC > /dev/null 2>&1; then
382 echo "A copy of VirtualBox is currently running. Please close it and try again."
383 echo "Please note that it can take up to ten seconds for VirtualBox (in particular"
384 echo "the VBoxSVC daemon) to finish running."
385 exit 1
386 fi
387 fi
388fi
389%if %{?rpm_suse:1}%{!?rpm_suse:0}
390%stop_on_removal vboxdrv
391%endif
392%if %{?rpm_mdv:1}%{!?rpm_mdv:0}
393%_preun_service vboxdrv
394%endif
395if [ "$1" = 0 ]; then
396%if %{?rpm_redhat:1}%{!?rpm_redhat:0}
397 /sbin/service vboxdrv stop > /dev/null
398 /sbin/chkconfig --del vboxdrv
399%endif
400 rm -f /etc/udev/rules.d/10-vboxdrv.rules
401 rm -f /etc/vbox/license_agreed
402 rm -f /etc/vbox/module_not_compiled
403fi
404DKMS=`which dkms 2>/dev/null`
405if [ -n "$DKMS" ]; then
406 $DKMS remove -m vboxhost -v %VER% --all > /dev/null 2>&1 || true
407fi
408
409
410%postun
411%if %{?rpm_redhat:1}%{!?rpm_redhat:0}
412if [ "$1" -ge 1 ]; then
413 /sbin/service vboxdrv restart > /dev/null 2>&1
414 /sbin/service vboxballoonctrl-service restart > /dev/null 2>&1
415 /sbin/service vboxautostart-service restart > /dev/null 2>&1
416 /sbin/service vboxweb-service restart > /dev/null 2>&1
417fi
418%endif
419%if %{?rpm_suse:1}%{!?rpm_suse:0}
420%restart_on_update vboxdrv vboxballoonctrl-service vboxautostart-service vboxweb-service
421%insserv_cleanup
422%endif
423%if %{?rpm_mdv:1}%{!?rpm_mdv:0}
424/sbin/ldconfig
425%{clean_desktop_database}
426%clean_menus
427%endif
428update-mime-database /usr/share/mime &> /dev/null || :
429update-desktop-database -q > /dev/null 2>&1 || :
430touch --no-create /usr/share/icons/hicolor
431gtk-update-icon-cache -q /usr/share/icons/hicolor 2> /dev/null || :
432rm -rf /usr/lib/virtualbox/ExtensionPacks
433
434
435%clean
436rm -rf $RPM_BUILD_ROOT
437
438
439%files
440%defattr(-,root,root)
441%doc %{!?is_ose: LICENSE}
442%doc UserManual*.pdf
443%doc %{!?is_ose: VirtualBox*.chm}
444%{_initrddir}/vboxdrv
445%{_initrddir}/vboxballoonctrl-service
446%{_initrddir}/vboxautostart-service
447%{_initrddir}/vboxweb-service
448%{?rpm_suse: %{py_sitedir}/*}
449%{!?rpm_suse: %{python_sitelib}/*}
450%{?rpm_suse: /sbin/rcvboxdrv}
451%{?rpm_suse: /sbin/rcvboxballoonctrl-service}
452%{?rpm_suse: /sbin/rcvboxautostart-service}
453%{?rpm_suse: /sbin/rcvboxweb-service}
454/etc/vbox
455/usr/bin/*
456/usr/src/vbox*
457/usr/lib/virtualbox
458/usr/share/applications/*
459/usr/share/icons/hicolor/*/apps/*
460/usr/share/icons/hicolor/*/mimetypes/*
461/usr/share/mime/packages/*
462/usr/share/pixmaps/*
463/usr/share/virtualbox
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette