~ubuntu-branches/ubuntu/wily/mysql-5.6/wily

« back to all changes in this revision

Viewing changes to packaging/rpm-sles/mysql.spec.in

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2015-04-16 20:07:10 UTC
  • mto: (1.3.9 vivid-proposed)
  • mto: This revision was merged to the branch mainline in revision 11.
  • Revision ID: package-import@ubuntu.com-20150416200710-pcrsa022082zj46k
Tags: upstream-5.6.24
ImportĀ upstreamĀ versionĀ 5.6.24

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
 
1
# Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
52
52
%global license_type          GPLv2
53
53
%endif
54
54
 
55
 
%if 0%{?sles_version} == 011
 
55
%if 0%{?suse_version} == 1110
56
56
%global dist                  .sles11
57
57
%global sles11                1
58
58
%endif
59
59
 
 
60
%if 0%{?suse_version} == 1315
 
61
%global dist                  .sles12
 
62
%global sles12                1
 
63
%endif
 
64
 
 
65
# https://en.opensuse.org/openSUSE:Systemd_packaging_guidelines
 
66
%{?sles12:                %global systemd 1}
 
67
%{!?_tmpfilesdir:         %global _tmpfilesdir /usr/lib/tmpfiles.d}
 
68
 
60
69
Name:           mysql-%{product_suffix}
61
70
Summary:        A very fast and reliable SQL database server
62
71
Group:          Applications/Databases
81
90
BuildRequires:  zlib-devel
82
91
%if 0%{?systemd}
83
92
BuildRequires:  systemd
 
93
BuildRequires:  pkgconfig(systemd)
 
94
BuildRequires:  systemd-rpm-macros
84
95
%endif
85
96
BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
86
97
 
118
129
Requires:       coreutils
119
130
Requires:       grep
120
131
Requires:       procps
121
 
Requires:       shadow-utils
122
132
Requires:       net-tools
123
133
Requires:       perl-base
124
134
%if 0%{?commercial}
140
150
Provides:       mysql = %{version}-%{release}
141
151
Provides:       mysql-tools = %{version}-%{release}
142
152
%if 0%{?systemd}
143
 
Requires(post):   systemd
144
 
Requires(preun):  systemd
145
 
Requires(postun): systemd
 
153
%{?systemd_requires}
146
154
%else
147
155
PreReq:         insserv
 
156
%endif
148
157
PreReq:         sed
149
158
PreReq:         pwdutils
150
 
%endif
151
159
Conflicts:      otherproviders(mysql)
152
160
Conflicts:      otherproviders(mysql-debug)
153
161
Conflicts:      otherproviders(mysql-tools)
265
273
Obsoletes:      MySQL-devel < %{version}-%{release}
266
274
Obsoletes:      mysql-devel < %{version}-%{release}
267
275
Obsoletes:      mariadb-devel
268
 
Obsoletes:      libmysqlclient-devel < %{version}-%{release}
 
276
Obsoletes:      libmysqlclient-devel
269
277
Provides:       mysql-devel = %{version}-%{release}
270
278
Provides:       libmysqlclient-devel = %{version}-%{release}
271
279
 
367
375
(
368
376
  cd debug
369
377
  # Attempt to remove any optimisation flags from the debug build
370
 
  optflags=$(echo "%{optflags}" | sed -e 's/-O2 / /' -e 's/-Wp,-D_FORTIFY_SOURCE=2/ /')
 
378
  optflags=$(echo "%{optflags}" | sed -e 's/-O2 / /' -e 's/-D_FORTIFY_SOURCE=2/ /' -e 's/-Wp, / /')
371
379
  cmake ../%{src_dir} \
372
380
           -DBUILD_CONFIG=mysql_release \
373
381
           -DINSTALL_LAYOUT=RPM \
420
428
# Ensure that needed directories exists
421
429
install -d -m 0755 %{buildroot}/var/lib/mysql
422
430
install -d -m 0755 %{buildroot}/var/run/mysql
423
 
install -d -m 0660 %{buildroot}/var/log/mysql
 
431
install -d -m 0750 %{buildroot}/var/log/mysql
424
432
 
425
433
# Install all binaries
426
434
cd $MBD/release
432
440
install -d %{buildroot}%{_sysconfdir}/my.cnf.d
433
441
%if 0%{?systemd}
434
442
install -D -m 0755 %{SOURCE1} %{buildroot}%{_bindir}/mysql-systemd-start
435
 
install -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/mysqld.service
 
443
install -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/mysql.service
436
444
%else
437
445
install -D -m 0755 $MBD/release/packaging/rpm-sles/mysql.init %{buildroot}%{_sysconfdir}/init.d/mysql
438
446
%endif
460
468
rm -rf %{buildroot}%{_bindir}/mysql_embedded
461
469
rm -rf %{buildroot}%{_bindir}/mysql_setpermission
462
470
rm -rf %{buildroot}%{_mandir}/man1/mysql_setpermission.1*
 
471
rm -f %{buildroot}%{_datadir}/mysql/win_install_firewall.sql 
463
472
 
464
473
# rcmysql symlink
465
474
install -d %{buildroot}%{_sbindir}
 
475
%if 0%{?systemd}
 
476
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcmysql
 
477
%else
466
478
ln -sf %{_initrddir}/mysql %{buildroot}%{_sbindir}/rcmysql
 
479
%endif
467
480
 
468
481
%check
469
482
%if 0%{?runselftest}
483
496
/usr/sbin/groupadd -r mysql >/dev/null 2>&1 || :
484
497
/usr/sbin/useradd -g mysql -o -r -d /var/lib/mysql -s /bin/false \
485
498
    -c "MySQL Server" -u 60 mysql >/dev/null 2>&1 || :
 
499
%if 0%{?systemd}
 
500
%service_add_pre mysql.service
 
501
%endif
486
502
 
487
503
%post server
488
504
datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p')
489
505
/bin/chmod 0755 "$datadir"
490
506
/bin/touch /var/log/mysql/mysqld.log
491
507
%if 0%{?systemd}
492
 
%systemd_post mysqld.service
493
 
/sbin/service mysqld enable >/dev/null 2>&1 || :
 
508
%service_add_post mysql.service
 
509
/usr/bin/systemd-tmpfiles --create %{_tmpfilesdir}/mysql.conf >/dev/null 2>&1 || :
 
510
/bin/systemctl enable mysql.service >/dev/null 2>&1 || :
494
511
%else
495
512
/sbin/insserv /etc/init.d/mysql
496
513
%endif
497
514
 
498
515
%preun server
499
516
%if 0%{?systemd}
500
 
%systemd_preun mysqld.service
 
517
%service_del_preun mysql.service
501
518
%else
502
519
if [ "$1" -eq 0 ]; then
503
520
    /usr/sbin/rcmysql stop >/dev/null 2>&1 || :
507
524
 
508
525
%postun server
509
526
%if 0%{?systemd}
510
 
%systemd_postun_with_restart mysqld.service
 
527
%service_del_postun mysql.service
511
528
%else
512
529
if [ $1 -ge 1 ]; then
513
530
    /usr/sbin/rcmysql condrestart >/dev/null 2>&1 || :
602
619
%attr(755, root, root) %{_libdir}/mysql/plugin/innodb_engine.so
603
620
%attr(755, root, root) %{_libdir}/mysql/plugin/libmemcached.so
604
621
%attr(755, root, root) %{_libdir}/mysql/plugin/mypluglib.so
 
622
%attr(755, root, root) %{_libdir}/mysql/plugin/mysql_no_login.so
605
623
%attr(755, root, root) %{_libdir}/mysql/plugin/semisync_master.so
606
624
%attr(755, root, root) %{_libdir}/mysql/plugin/semisync_slave.so
607
625
%attr(755, root, root) %{_libdir}/mysql/plugin/validate_password.so
611
629
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/innodb_engine.so
612
630
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/libmemcached.so
613
631
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/mypluglib.so
 
632
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/mysql_no_login.so
614
633
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/semisync_master.so
615
634
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/semisync_slave.so
616
635
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/validate_password.so
619
638
%attr(755, root, root) %{_libdir}/mysql/plugin/authentication_pam.so
620
639
%attr(755, root, root) %{_libdir}/mysql/plugin/thread_pool.so
621
640
%attr(755, root, root) %{_libdir}/mysql/plugin/openssl_udf.so
 
641
%attr(755, root, root) %{_libdir}/mysql/plugin/firewall.so 
 
642
%attr(644, root, root) %{_datadir}/mysql/linux_install_firewall.sql 
622
643
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/audit_log.so
623
644
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/authentication_pam.so
624
645
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/thread_pool.so
625
646
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/openssl_udf.so
 
647
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/firewall.so 
626
648
%endif
627
649
%attr(644, root, root) %{_datadir}/mysql/fill_help_tables.sql
628
650
%attr(644, root, root) %{_datadir}/mysql/mysql_system_tables.sql
636
658
%attr(644, root, root) %{_datadir}/mysql/magic
637
659
%attr(644, root, root) %{_prefix}/lib/tmpfiles.d/mysql.conf
638
660
%if 0%{?systemd}
639
 
%attr(644, root, root) %{_unitdir}/mysqld.service
 
661
%attr(644, root, root) %{_unitdir}/mysql.service
640
662
%else
641
663
%attr(755, root, root) %{_sysconfdir}/init.d/mysql
642
664
%endif
643
665
%attr(644, root, root) %config(noreplace,missingok) %{_sysconfdir}/logrotate.d/mysql
644
666
%dir %attr(755, mysql, mysql) /var/lib/mysql
645
667
%dir %attr(755, mysql, mysql) /var/run/mysql
646
 
%dir %attr(660, mysql, mysql) /var/log/mysql
 
668
%dir %attr(750, mysql, mysql) /var/log/mysql
647
669
 
648
670
%files common
649
671
%defattr(-, root, root, -)
793
815
%attr(755, root, root) %{_libdir}/mysql/libmysqld.so
794
816
 
795
817
%changelog
 
818
* Wed Jan 14 2015 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.24-1
 
819
- Add mysql_no_login.so plugin
 
820
 
796
821
* Mon Oct 06 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.22-1
797
822
- Backport to 5.6.22
798
823