# This is an example spec file for e-smith add-on modules. # The Summary line is a single line description of the module. Summary: WebCal for SME Server # anything starting with a % sign is a command that is interpreted by # the RPM program. Using % commands we can set values and use them # again later. # here we define a base name for the module, which will get used in # various places. This makes life easier for us because we only ever # have to change the name once, rather than every time it appears in the # spec file # usually we name non-e-smith-specific software with whatever its normal # name is. If we were doing the e-smith-specific bits in a separate RPM, #we'd probably call it e-smith-CoolApp %define name webcal # now you'll see how we refer to a value we've set previously. If we # did "%define foo bar" we can use "%{foo}" to insert "bar" in that # place. Name: %{name} # and some more of the same with version and release numbers. # See http://www.e-smith.org/docs/versions.php3 to find out how e-smith # number their versions -- you may like to do similarly. %define version 3.03 %define release 2ps Version: %{version} Release: %{release} # The copyright should be "GPL" for any contrib module you hope to # make available for other e-smith users Copyright: GPL # The Group should indicate the type of application you're packaging. # It is used to group RPMs logically in various user interfaces. # You can find a list of groups at # http://rpmfind.net/linux/RPM/Groups.html Group: Web/Applications # This is the name of the source file to use. Notice how we generate it # based on the name and version we set earlier? Source: %{name}-%{version}.tar.gz # If you are using patch files, put some statements like this to define # patch levels: # Patch0: %{name}-%{version}.patch.2001013100 # Patch1: %{name}-%{version}.patch.2001020200 # Patch2: %{name}-%{version}.patch.2001022000 # Note that this is a slightly more advanced use; fuller documentation # on this is forthcoming. # The Packager is the name and email address of the person who packaged # this software for e-smith, who may be a different person to the one # who originally wrote it. Packager: Placido Sanchez # Where to do the work of building the RPMs. This should be a temporary # directory unique to this package, hence we use the name, version and # release values we set earlier to make up the directory name BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot # What architectures do we want to build this for? Use "i386" if your # software is compiled, or "noarch" if it will run on any platform # without compiling. Examples of the latter include software written in # Perl and many web applications. Most e-smith management RPMs should # be "noarch" BuildArchitectures: noarch # What software is required to build the RPM? This lets the RPM program # figure out whether it will be able to build the RPM successfully. # You can either specify just the name of the software (eg "perl") or # specify a minimum version ("e-smith-devtools >= 0.1-3" means that this # software requires the package e-smith-devtools version 0.1-3 or higher # to run correctly. #BuildRequires: e-smith-devtools >= 0.1-3 # What software is required for the RPM to run correctly once it's # installed on a system? This has the same format as BuildRequires #Requires: CoolApp >= 2.2 Requires: perl-DBD-MySQL Requires: perl-DBI # typically, e-smith-CoolApp will require CoolApp, so you have to have # the base software installed before you can install the e-smith bits to # configure it # This turns off automatic dependency processing that can sometimes # cause problems AutoReqProv: no # The description is a slightly more verbose version of the summary %description WebCal is a free browser based calendar program to help you keep track of your appointments, meetings, birthdays, whatever. # The changelog records changes made with each version. Make sure these # are in exactly the right format, otherwise the RPM will not build. %changelog * Tue Apr 23 2002 Placido Sanchez - Made the second RPM for SME, also fixed the /tmp error. * Fri Apr 19 2002 Placido Sanchez - Made the first RPM for SME. %prep # The prep and setup sections describe what to do to prepare the source code # for building. For instance, this is where you would apply patches if # you were using them. %setup #%patch0 -p1 #%patch1 -p1 #%patch2 -p1 # The pre section lists commands to run prior to installing the software # on the e-smith system. This may mean things like signalling e-smith # events or running action scripts %pre # The post section lists commands to run after installing the software # on the e-smith system. This may mean things like signalling e-smith # events or running action scripts %post MATRIX="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" LENGTH="8" while [ "${n:=1}" -le "$LENGTH" ]; do PASS="$PASS${MATRIX:$(($RANDOM%${#MATRIX})):1}" let n+=1 done db_pass=$PASS echo $db_pass > ~/.webcal.pw echo -n "Setting up MySQL...." /bin/cat /opt/WebCal/mysql/mysql_setup.skel | /bin/sed -e "s/DB_PASS/$db_pass/" > /tmp/webcalsetup.txt /usr/bin/mysql < /tmp/webcalsetup.txt > /tmp/webcal_mysql_setup.log echo "Done! Check /tmp/webcal_mysql_setup.log for errors." /bin/rm -f /tmp/webcalsetup.txt echo "package webcal_conf; my \$libdir = \"/opt/WebCal/cgi-bin\"; # # Variables to be included for all WebCal cgi scripts... # Variables for color, look, and feel are further down in this file # # # Database variables, if not using flat files # \$DB = \"webcal\"; \$DB_TABLE = \"webcal\"; \$DB_USER = \"webcal\"; \$DB_PASS = \"$db_pass\"; # # HT_HOME: full unix path to the base html directory of your webserver. # \$HT_HOME = \"/opt/WebCal/cgi-bin\"; # # DOC_ROOT: where are our cgi scripts located. This directory should include # the "protected" subdirectory, where the data operations cgi lives. # \$DOC_ROOT = \"webcal\"; # # IMAGE_DIR: how to access images we need. # \$IMAGE_DIR = \"/webcal/icons\"; \$ICON_DIR = \"/opt/WebCal/cgi-bin/icons\"; # # DB_DIR: where subdirectories for each calendar are at. # \$DB_DIR = \"/opt/WebCal/files\"; " > /opt/WebCal/cgi-bin/webcal_conf.pm /bin/cat /opt/WebCal/webcal_conf.pm.org >> /opt/WebCal/cgi-bin/webcal_conf.pm /usr/bin/crontab -l > /tmp/message.$$ /bin/grep "webcal_remind" /tmp/message.$$ >/dev/null if [ $? -eq 1 ] ; then echo "#" >> /tmp/message.$$ echo "# webcal messaging" >> /tmp/message.$$ echo "#" >> /tmp/message.$$ echo "0,5,10,15,20,25,30,35,40,45,50,55 * * * * /opt/WebCal/bin/webcal_remind.pl >> /opt/WebCal/files/message.log 2>&1" >> /tmp/message.$$ /usr/bin/crontab /tmp/message.$$ /bin/rm -f /tmp/message.$$ echo "crontab updated" else echo "crontab already set up for messaging" fi echo -n "Converting 'US Holidays' data..." /opt/WebCal/bin/flat2rdb.pl -d webcal -u webcal -p $db_pass -t webcal -f /opt/WebCal/files/US\ Holidays/cal.dat -r mysql 2>/dev/null echo "" echo "WebCal URL: www.server.com/webcal/" echo "" echo "If you need to convert your flat databases to mysql " echo "take a look at the utils in /opt/WebCal/bin" echo "" echo "MySQL DB=webcal User=webcal Table=webcal Password is in ~/.webcal.pw" echo -n "Apache is running as : " cat /etc/httpd/conf/httpd.conf | grep "^User" | cut -d " " -f 2 echo "" echo "IMPORTANT: The database format has changed in version 3.02. If you are" echo "installing from scratch, you will be fine. If you are installing over" echo "a previous 3.01 or 3.0 WebCal installation, you will need to use the" echo "db_convert.pl script in the /opt/WebCal/bin directory to upgrade your database." echo "" /bin/chown `cat /etc/httpd/conf/httpd.conf | grep "^User" | cut -d " " -f 2` /opt/WebCal/files /bin/chmod 700 /opt/WebCal/files /bin/chown `cat /etc/httpd/conf/httpd.conf | grep "^User" | cut -d " " -f 2` "/opt/WebCal/files/.htpasswd" /bin/chmod 600 "/opt/WebCal/files/.htpasswd" /bin/chown -R `cat /etc/httpd/conf/httpd.conf | grep "^User" | cut -d " " -f 2` "/opt/WebCal/files/US Holidays" /bin/chmod -R 700 "/opt/WebCal/files/US Holidays" /bin/chown `cat /etc/httpd/conf/httpd.conf | grep "^User" | cut -d " " -f 2` "/opt/WebCal/cgi-bin/webcal"* /bin/chmod 755 "/opt/WebCal/cgi-bin/webcal.cgi" /bin/chmod 600 "/opt/WebCal/cgi-bin/webcal_conf.pm" /bin/chown -R `cat /etc/httpd/conf/httpd.conf | grep "^User" | cut -d " " -f 2` "/opt/WebCal/cgi-bin/protected" /bin/chmod -R 755 "/opt/WebCal/cgi-bin/protected" /bin/chmod 755 "/opt/WebCal/bin/webcal_remind.pl" /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf /etc/e-smith/events/actions/restart-httpd-graceful # The build section lists commands to run as part of the build process # For something that doesn't require any building (as is the case with # most e-smith-AppName modules, containing just config templates, Perl # scripts, etc, you can leave this blank. %build # The install section lists commands to run during the build phase to # emulate the steps taken by "make install" in a non-RPM context. Keep # in mind that we don't actually want to install the software on our # development system, we want it installed into our BUILD directory. # The variable $RPM_BUILD_ROOT is available to us for convenience, to # refer to the directory rpms/BUILD/yourappname/root (or whatever's set # in the BuildRoot line near the top of this spec file. %install rm -rf $RPM_BUILD_ROOT # now we generate a file list so we know what's in the RPM; see the # %files section below for how it's actually used (cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) rm -f e-smith-%{version}-filelist #/sbin/e-smith/genfilelist $RPM_BUILD_ROOT | /bin/sed -e 's/US Holidays/"US Holidays"/' > %{name}-%{version}-filelist %clean rm -rf $RPM_BUILD_ROOT #%files -f %{name}-%{version}-filelist %files %dir %attr(0755,root,root) /opt/WebCal /opt/WebCal/webcal_conf.pm.org %dir %attr(0755,root,root) /opt/WebCal/mysql /opt/WebCal/mysql/mysql_setup.skel /opt/WebCal/mysql/webcal_io_mysql.pm %dir %attr(0755,root,root) /opt/WebCal/files /opt/WebCal/files/.htpasswd /opt/WebCal/files/message.log %dir %attr(0755,root,root) "/opt/WebCal/files/US Holidays" "/opt/WebCal/files/US Holidays/.users" "/opt/WebCal/files/US Holidays/.public" "/opt/WebCal/files/US Holidays/cal.dat" %dir %attr(0755,root,root) /opt/WebCal/cgi-bin /opt/WebCal/cgi-bin/webcal.br-portuguese /opt/WebCal/cgi-bin/webcal.catalan /opt/WebCal/cgi-bin/webcal.cgi /opt/WebCal/cgi-bin/webcal.chinese /opt/WebCal/cgi-bin/webcal_conf.pm /opt/WebCal/cgi-bin/webcal.croatian /opt/WebCal/cgi-bin/webcal.danish /opt/WebCal/cgi-bin/webcal.dutch /opt/WebCal/cgi-bin/webcal.english /opt/WebCal/cgi-bin/webcal.finnish /opt/WebCal/cgi-bin/webcal.french /opt/WebCal/cgi-bin/webcal.german /opt/WebCal/cgi-bin/webcal_io.pm /opt/WebCal/cgi-bin/webcal.italian /opt/WebCal/cgi-bin/webcal.russian /opt/WebCal/cgi-bin/webcal_shared.pm /opt/WebCal/cgi-bin/webcal.spanish /opt/WebCal/cgi-bin/webcal.swedish /opt/WebCal/cgi-bin/index.shtml %dir %attr(0755,root,root) /opt/WebCal/cgi-bin/protected /opt/WebCal/cgi-bin/protected/.htaccess /opt/WebCal/cgi-bin/protected/webcal2.cgi /opt/WebCal/cgi-bin/protected/webcal_admin.cgi /opt/WebCal/cgi-bin/protected/webcal_synch_server.cgi %dir %attr(0755,root,root) /opt/WebCal/cgi-bin/icons /opt/WebCal/cgi-bin/icons/assim.jpg /opt/WebCal/cgi-bin/icons/bomb.gif /opt/WebCal/cgi-bin/icons/day.english.jpg /opt/WebCal/cgi-bin/icons/dot_clear.gif /opt/WebCal/cgi-bin/icons/month.english.jpg /opt/WebCal/cgi-bin/icons/powered.jpg /opt/WebCal/cgi-bin/icons/text.gif /opt/WebCal/cgi-bin/icons/week.english.jpg /opt/WebCal/cgi-bin/icons/year.english.jpg %dir %attr(0755,root,root) /opt/WebCal/bin /opt/WebCal/bin/webcal_remind.pl /opt/WebCal/bin/clear_pilot.pl /opt/WebCal/bin/db_clean.pl /opt/WebCal/bin/db_convert.pl /opt/WebCal/bin/db_merge.pl /opt/WebCal/bin/dump_pilot.pl /opt/WebCal/bin/flat2rdb.pl /opt/WebCal/bin/rdb2flat.pl /opt/WebCal/bin/webcal_synch_client.pl %dir %attr(0755,root,root) /etc/e-smith %dir %attr(0755,root,root) /etc/e-smith/templates-custom %dir %attr(0755,root,root) /etc/e-smith/templates-custom/etc %dir %attr(0755,root,root) /etc/e-smith/templates-custom/etc/httpd %dir %attr(0755,root,root) /etc/e-smith/templates-custom/etc/httpd/conf %dir %attr(0755,root,root) /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/90e-smithAccess50WebCal