]> git.pld-linux.org Git - packages/mysql.git/blob - mysql.spec
- "s-/usr/lib/-%{_libdir}-"
[packages/mysql.git] / mysql.spec
1 Summary:        MySQL: a very fast and reliable SQL database engine
2 Name:           MySQL
3 Version:        3.22.14b-gamma
4 Release:        3
5 Vendor:         LinuxLand International
6 Copyright:      MySQL FREE PUBLIC LICENSE (See the file PUBLIC)
7 Group:          Applications/Databases
8 Source0:        http://www.tcx.se/Downloads/MySQL-3.22/mysql-%{mysql-version}.tar.gz
9 Icon:           mysql.gif
10 URL:            http://www.tcx.se/
11 BuildRoot:      /tmp/%{Name}-%{Version}-root
12
13 %Description
14 MySQL is a true multi-user, multi-threaded SQL (Structured Query Language)
15 database server. SQL is the most popular database language in the world.
16 MySQL is a client/server implementation that consists of a server daemon
17 mysqld and many different client programs/libraries. The main goals of MySQL
18 are speed, robustness and easy to use.  The base upon which MySQL is built
19 is a set of routines that have been used in a highly demanding production
20 environment for many years. While MySQL is still in development, it already
21 offers a rich and highly useful function set. See the documentation for more
22 information
23
24 %Package client
25 Summary:        MySQL client programs and libs
26 Group:          Applications/Databases
27 Requires:       %{name} = %{version}-%{release}
28
29 %Description client
30 This package contains the client part of the MySQL database. It includes
31 utilities and libraries to access and manipulate data on a MySQL database
32 Server.
33
34 %Package devel
35 Summary:        MySQL development header files and libraries
36 Group:          Applications/Databases
37 Requires:       %{name} = %{version}-%{release}
38
39 %Description devel
40 This package contains the header files and libraries (shared and static) for
41 developing applications that use the MySQL database.
42
43 %prep
44 %setup -n
45
46 %build
47
48 CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" \
49 ./configure %{_target} \
50         --enable-shared \
51         --enable-static \
52         --enable-assembler \
53         --with-mysqld-user=mysql \
54         --with-unix-socket-path=/var/lib/mysql/mysql.sock \
55         --prefix=/usr \
56         --sysconfdir=/etc \
57         --localstatedir=/var/lib/mysql
58
59 # benchdir does not fit in above model. Fix when we make a separate package
60 make benchdir=$RPM_BUILD_ROOT/usr/share/sql-bench
61
62 %install
63
64 %{mkDESTDIR}
65
66 # Ensure that needed directories exists
67 install -d $DESTDIR/var/lib/mysql/mysql
68 install -d $DESTDIR/usr/share/sql-bench
69 install -d $DESTDIR/usr/{sbin,share,man,include}
70 install -d $DESTDIR/usr/doc/MySQL-%{mysql-version}
71
72 # Make install
73 make install-strip DESTDIR=$DESTDIR benchdir=/usr/share/sql-bench
74
75 # fixme: can´t this be done via configure?
76 mv $DESTDIR%{_libdir}/mysql/*.so* $DESTDIR/usr/lib
77
78 # Install logrotate and autostart
79 MBD=$RPM_BUILD_DIR/mysql-%{mysql-version}
80 mkdir -p $DESTDIR/etc/logrotate.d
81 install -m644 $MBD/support-files/mysql-log-rotate $DESTDIR/etc/logrotate.d/mysql
82 mkdir -p $DESTDIR/etc/rc.d/init.d
83 install -m755 $MBD/support-files/mysql.server $DESTDIR/etc/rc.d/init.d/mysql
84
85 # daemon startup control
86 mkdir -p $DESTDIR/etc/sysconfig/daemons
87 cat <<EOF > $DESTDIR/etc/sysconfig/daemons/mysql
88 IDENT=mysql
89 DESCRIPTIVE="MySQL database server"
90 ONBOOT=no
91 EOF
92
93 # Install docs
94 install -m644 $RPM_BUILD_DIR/mysql-%{mysql-version}/Docs/mysql.info \
95  $DESTDIR%{_infodir}/mysql.info
96 for file in README PUBLIC Docs/manual_toc.html Docs/manual.html \
97     Docs/manual.txt Docs/manual.texi Docs/manual.ps
98 do
99     b=`basename $file`
100     install -m644 $MBD/$file $DESTDIR/usr/doc/MySQL-%{mysql-version}/$b
101 done
102
103
104 %Clean
105
106 %{rmDESTDIR}
107
108
109
110 %Pre
111 if test -x /etc/rc.d/init.d/mysql
112 then
113   /etc/rc.d/init.d/mysql stop > /dev/null 2>&1
114   echo "Giving mysqld a couple of seconds to exit nicely"
115   sleep 5
116 fi
117
118 %Post
119 mysql_datadir=/var/lib/mysql
120
121 # Create data directory if needed
122 if test ! -d $mysql_datadir;            then mkdir $mysql_datadir; fi
123 if test ! -d $mysql_datadir/mysql;      then mkdir $mysql_datadir/mysql; fi
124 if test ! -d $mysql_datadir/test;       then mkdir $mysql_datadir/test; fi
125
126 # Make MySQL start/shutdown automatically when the machine does it.
127 lisa --SysV-init install  mysql S35 3:4:5 K65 0:1:2:6
128
129 # Create a MySQL user. Do not report any problems if it already
130 # exists.
131 echo "Creating system group mysql with GID 83"
132 #lisa --group create mysql :sys:
133 /usr/sbin/groupadd -g 83 mysql
134
135 echo "Creating system user mysql with UID 83"
136 #lisa --user create mysql :sys: mysql "MySQL Database" $mysql_datadir /bin/bash
137 /usr/sbin/useradd -u 83 -g mysql -d $mysql_datadir -s /bin/bash mysql
138
139 # Change permissions so that the user that will run the MySQL daemon
140 # owns all database files.
141 chown -R mysql.mysql $mysql_datadir
142
143 # Initiate databases
144 mysql_install_db -IN-RPM
145
146 # Change permissions again to fix any new files.
147 chown -R mysql.mysql $mysql_datadir
148
149 # Restart in the same way that mysqld will be started normally.
150 /etc/rc.d/init.d/mysql start
151
152 # Allow safe_mysqld to start mysqld and print a message before we exit
153 sleep 2
154
155
156 %preUn
157 if test -x /etc/rc.d/init.d/mysql
158 then
159   /etc/rc.d/init.d/mysql stop > /dev/null
160 fi
161 # Remove autostart of mysql
162 lisa --SysV-init remove mysql $1
163
164 %postun -p /sbin/ldconfig
165
166 %post client -p /sbin/ldconfig
167
168 # We do not remove the mysql user since it may still own a lot of
169 # database files.
170
171 %Files
172 %defattr(644,root,root,755)
173 %doc /usr/doc/MySQL-%{mysql-version}/
174
175 %attr(755,root,root) /usr/bin/isamchk
176 %attr(755,root,root) /usr/bin/isamlog
177 %attr(755,root,root) /usr/bin/mysql_fix_privilege_tables
178 %attr(755,root,root) /usr/bin/mysql_install_db
179 %attr(755,root,root) /usr/bin/mysql_setpermission
180 %attr(755,root,root) /usr/bin/mysql_zap
181 %attr(755,root,root) /usr/bin/mysqlbug
182 %attr(755,root,root) /usr/bin/perror
183 %attr(755,root,root) /usr/bin/replace
184 %attr(755,root,root) /usr/bin/resolveip
185 %attr(755,root,root) /usr/bin/safe_mysqld
186
187 %attr(644,root,root) %{_infodir}/mysql.info
188
189 %attr(755,root,root) /usr/sbin/mysqld
190
191 %attr(644,root,root) /etc/logrotate.d/mysql
192 %attr(754,root,root) /etc/rc.d/init.d/mysql
193 %config /etc/sysconfig/daemons/mysql
194
195 %attr(755,root,root) /usr/share/mysql/
196
197 %Files client
198 %attr(755,root,root) %{_libdir}/libmysqlclient.so.*.*
199
200 %attr(755,root,root) /usr/bin/msql2mysql
201 %attr(755,root,root) /usr/bin/mysql
202 %attr(755,root,root) /usr/bin/mysqlaccess
203 %attr(755,root,root) /usr/bin/mysqladmin
204 %attr(755,root,root) /usr/bin/mysqlbug
205 %attr(755,root,root) /usr/bin/mysqldump
206 %attr(755,root,root) /usr/bin/mysqlimport
207 %attr(755,root,root) /usr/bin/mysqlshow
208
209 %{_mandir}/man1/mysql.1.*
210
211
212 %Files devel
213 %dir /usr/include/mysql
214 %dir %{_libdir}/mysql
215 %attr(644,root,root) /usr/include/mysql/*
216 %attr(644,root,root) %{_libdir}/mysql/*
217 %attr(644,root,root) %{_libdir}/libmysqlclient.so
218 %attr(755,root,root) /usr/bin/comp_err
219
220 %ChangeLog
221 * Thu Jan 25 1999 Stephan Seyboth <sseyboth@linuxland.de>
222 - user/group creation doesn´t work with lisa-3.2, use useradd/groupadd,
223    hope nothing else uses uid/gid 83???
224
225 * Thu Jan 07 1999 Stephan Seyboth <sseyboth@linuxland.de>
226 - converted to COL style init
227 - updated to 3.22.14b-gamma
228
229 * Mon Dec 14 1998 Stephan Seyboth <sseyboth@linuxland.de>
230 - updated to mysql 3.22.12-beta
231
232 * Fri Dec 11 1998 Stephan Seyboth <sseyboth@linuxland.de>
233 - added mysql_fix_privilege_tables, needed by postin
234
235 * Thu Dec 10 1998 Stephan Seyboth <sseyboth@linuxland.de>
236 - don´t build mysqld with all-static (where´s libdl.a on COL?)
237
238 * Wed Dec 09 1998 Stephan Seyboth <sseyboth@linuxland.de>
239 - initial Version based on rpm by David Axmark <david@detron.se>
This page took 0.045338 seconds and 3 git commands to generate.