- updated to 3.0.2.32703 auto/th/Firebird-3.0.2.32703-1
authorBartek Szady <bszx@bszx.eu>
Tue, 4 Apr 2017 08:10:30 +0000 (10:10 +0200)
committerBartek Szady <bszx@bszx.eu>
Tue, 4 Apr 2017 08:10:30 +0000 (10:10 +0200)
- added classic and superserver (ss) subpackages

Firebird.spec
config.patch [new file with mode: 0644]
firebird-classic.service [new file with mode: 0644]
firebird-classic.socket [new file with mode: 0644]
firebird.service [new file with mode: 0644]
firebird.tmpfiles [new file with mode: 0644]
server_mode-classic.conf [new file with mode: 0644]
server_mode-ss.conf [new file with mode: 0644]

index 7a19bf0..7174eda 100644 (file)
@@ -1,28 +1,26 @@
 # TODO:
 # - check running
 # - 2.5 -> 3.0 migration?
-# - systemd support (see builds/install/arch-specific/linux : gen/install/misc/*)
 # - more docs from http://www.firebirdsql.org/en/reference-manuals/ ?
 # - kill unaligned accesses (create_db,gpre_current,gbak_static,isql_static) on alpha
 #   - check if it's fixed now (RISC_ALIGNMENT is defined)
-# - create classic server/super server subpackages and drop bcond
-#   (see firebird2 on debian how to do it)
+# - check classic subpackage pre/post scripts
 # - logrotate script
-#
-# Conditional build:
-%bcond_with    ss      # Super Server (standalone daemon instead of inetd service)
+# - create SYSDBA user with initial password before first firebird start
+#   eg.:
+#     su firebird
+#     echo "create user SYSDBA password 'masterkey';"|fb_isql -u SYSDBA /var/lib/firebird/security3.fdb
 #
 Summary:       Firebird SQL Database Server and Client tools
 Summary(de.UTF-8):     Firebird - relationalen Open-Source- Datenbankmanagementsystems
 Summary(pl.UTF-8):     Firebird - serwer baz danych SQL oraz narzÄ™dzia klienckie
 Name:          Firebird
-# FirebirdCS/FirebirdSS (Classic Server/Super Server)?
-Version:       3.0.1.32609
+Version:       3.0.2.32703
 Release:       1
 License:       Interbase Public License 1.0, Initial Developer's Public License 1.0
 Group:         Applications/Databases
 Source0:       http://downloads.sourceforge.net/firebird/%{name}-%{version}-0.tar.bz2
-# Source0-md5: 85e2ace3d6950793d4c6917473e00c74
+# Source0-md5: 1fdc121ab04d2c2772d778e45ecd5689
 Source1:       http://www.firebirdsql.org/file/documentation/reference_manuals/user_manuals/Firebird-3-QuickStart.pdf
 # Source1-md5: 8e029d449e9cb3e1da8213ac6c11ad02
 # distfiles refuses this, would require some audit to allow '('/')' chars
@@ -45,6 +43,12 @@ Source9:     http://www.firebirdsql.org/doc/contrib/fb_2_1_errorcodes.pdf
 Source100:     firebird.init
 Source101:     firebird.sysconfig
 Source102:     firebird.inetd
+Source103:     firebird.tmpfiles
+Source104:     firebird.service
+Source105:     firebird-classic.service
+Source106:     firebird-classic.socket
+Source107:     server_mode-ss.conf
+Source108:     server_mode-classic.conf
 Patch0:                %{name}-chmod.patch
 Patch1:                %{name}-editline.patch
 Patch2:                %{name}-va.patch
@@ -56,6 +60,7 @@ Patch7:               Make-the-generated-code-compatible-with-gcc-6-in-C-1.patch
 Patch8:                Provide-sized-global-delete-operators-when-compiled.patch
 Patch9:                parallel-build.patch
 Patch10:       no-copy-from-icu.patch
+Patch11:       config.patch
 URL:           http://www.firebirdsql.org/
 BuildRequires: autoconf >= 2.67
 BuildRequires: automake
@@ -73,10 +78,6 @@ BuildRequires:       sed >= 4.0
 BuildRequires: zlib-devel
 Requires:      %{name}-dirs = %{version}-%{release}
 Requires:      %{name}-lib = %{version}-%{release}
-%if %{with ss}
-Requires(post,preun):  /sbin/chkconfig
-Requires:      rc-scripts
-%endif
 # official ports are x86, x86_64, ppc, sparc, arm, mips/mipsel, ia64
 # alpha is added in morearchs patch
 # see morearchs patch if you want more
@@ -158,6 +159,24 @@ Extensive InterBase and Firebird documentation.
 %description doc -l pl.UTF-8
 Obszerna dokumentacja do baz InterBase i Firebird.
 
+%package ss
+Summary:       Firebird Superserver init scripts
+Group:         Applications/Databases
+Requires:      %{name} = %{version}-%{release}
+Requires(post,preun):  /sbin/chkconfig
+Requires:      rc-scripts
+
+%description ss
+Firebird Superserver init scripts.
+
+%package classic
+Summary:       Firebird Classic init scripts
+Group:         Applications/Databases
+Requires:      %{name} = %{version}-%{release}
+
+%description classic
+Firebird Classic init scripts.
+
 %prep
 %setup -q -n %{name}-%{version}-0
 %patch0 -p1
@@ -171,6 +190,7 @@ Obszerna dokumentacja do baz InterBase i Firebird.
 %patch8 -p1
 %patch9 -p1
 %patch10 -p1
+%patch11 -p1
 
 mkdir docs
 cp %{SOURCE1} %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{SOURCE7} %{SOURCE8} %{SOURCE9} docs
@@ -199,8 +219,7 @@ cp %{SOURCE1} %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{SOURCE7} %{SOURCE8}
        --with-system-editline \
        %{?debug:--enable-debug} \
        --disable-rpath \
-       --disable-binreloc \
-       %{?with_ss:--enable-superserver} \
+       --disable-binreloc
 
 %{__make} -j1
 
@@ -209,22 +228,25 @@ rm -rf $RPM_BUILD_ROOT
 
 %{__make} -C src -f ../gen/Makefile.install buildImageDir
 
-install -d $RPM_BUILD_ROOT%{_sysconfdir}/{firebird,rc.d/init.d,sysconfig/rc-inetd}
+install -d $RPM_BUILD_ROOT%{_sysconfdir}/{firebird{,/conf.d},rc.d/init.d,sysconfig/rc-inetd}
 install -d $RPM_BUILD_ROOT{%{_bindir},%{ibdir},%{_libdir},%{_includedir}} \
 install -d $RPM_BUILD_ROOT/var/{log,lib/firebird} \
        $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
-
+install -d $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d
+install -d $RPM_BUILD_ROOT%{systemdunitdir}
+cp -p %{SOURCE103} $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d/firebird.conf
 touch $RPM_BUILD_ROOT/var/log/firebird.log
 
 cd gen/buildroot
-install var/lib/firebird/security3.fdb $RPM_BUILD_ROOT/var/lib/firebird
-install etc/firebird/*.conf $RPM_BUILD_ROOT%{_sysconfdir}/firebird
+cp -p var/lib/firebird/security3.fdb $RPM_BUILD_ROOT/var/lib/firebird
+cp -p etc/firebird/*.conf $RPM_BUILD_ROOT%{_sysconfdir}/firebird
 chmod 755 usr/include/firebird/impl
 cp -pr usr/include/* $RPM_BUILD_ROOT%{_includedir}
 cp -dp usr/%{_lib}/*.so* $RPM_BUILD_ROOT%{_libdir}
 cd .%{ibdir}
 cp -a UDF bin help intl plugins firebird.msg $RPM_BUILD_ROOT%{ibdir}
 ln -s %{ibdir}/intl $RPM_BUILD_ROOT%{_sysconfdir}/firebird
+ln -s %{ibdir}/{UDF,bin,plugins,firebird.msg} $RPM_BUILD_ROOT%{_sysconfdir}/firebird
 chmod u+w -R examples # allow further cleaning
 cp -rf examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
 
@@ -234,14 +256,21 @@ ln -sf libfbclient.so.2 $RPM_BUILD_ROOT%{_libdir}/libgds.so
 for f in bin/{fb_lock_print,gbak,gfix,gpre,gsec,gsplit,gstat,nbackup}; do
        ln -sf %{ibdir}/$f $RPM_BUILD_ROOT%{_bindir}/${f#bin/}
 done
+ln -sf %{ibdir}/bin/isql $RPM_BUILD_ROOT%{_bindir}/fb_isql
 
-%if %{with ss}
-install %{SOURCE100} $RPM_BUILD_ROOT/etc/rc.d/init.d/firebird
-install %{SOURCE101} $RPM_BUILD_ROOT/etc/sysconfig/firebird
+rm -f $RPM_BUILD_ROOT%{ibdir}/bin/{FirebirdUninstall.sh,changeServerMode.sh}
+
+sed -e 's|/usr/lib|%{_libdir}|' %{SOURCE100} >$RPM_BUILD_ROOT/etc/rc.d/init.d/firebird
+cp -p %{SOURCE101} $RPM_BUILD_ROOT/etc/sysconfig/firebird
+sed -e 's|/usr/lib|%{_libdir}|' %{SOURCE104} >$RPM_BUILD_ROOT%{systemdunitdir}/firebird.service
 install -d $RPM_BUILD_ROOT/var/run/firebird
-%else
+
 sed -e 's|/usr/lib|%{_libdir}|' %{SOURCE102} >$RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/firebird
-%endif
+sed -e 's|/usr/lib|%{_libdir}|' %{SOURCE105} >$RPM_BUILD_ROOT%{systemdunitdir}/firebird-classic@.service
+cp -p %{SOURCE106} $RPM_BUILD_ROOT%{systemdunitdir}/firebird-classic.socket
+
+cp -p %{SOURCE107} $RPM_BUILD_ROOT%{_sysconfdir}/firebird/conf.d/
+cp -p %{SOURCE108} $RPM_BUILD_ROOT%{_sysconfdir}/firebird/conf.d/
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -250,26 +279,38 @@ rm -rf $RPM_BUILD_ROOT
 %groupadd -g 145 firebird
 %useradd -u 145 -d %{ibdir} -s /bin/sh -g firebird -c "Firebird Server" firebird
 
-%if %{with ss}
-%post
+%postun
+if [ "$1" = "0" ]; then
+       %userremove firebird
+       %groupremove firebird
+fi
+
+%post  lib -p /sbin/ldconfig
+%postun        lib -p /sbin/ldconfig
+
+%post ss
 /sbin/chkconfig --add firebird
 %service firebird restart
+%systemd_post firebird.service
 
-%preun
+%preun ss
 if [ "$1" = "0" ]; then
        %service firebird stop
        /sbin/chkconfig --del firebird
 fi
-%endif
+%systemd_preun firebird.service
 
-%postun
-if [ "$1" = "0" ]; then
-       %userremove firebird
-       %groupremove firebird
-fi
+%postun ss
+%systemd_reload
 
-%post  lib -p /sbin/ldconfig
-%postun        lib -p /sbin/ldconfig
+%post classic
+%systemd_post firebird-classic@.service firebird-classic.socket
+
+%preun classic
+%systemd_preun firebird-classic@.service firebird-classic.socket
+
+%postun classic
+%systemd_reload
 
 %triggerpostun -- %{name} < 2.1.1.17910-2
 if [ -f %{ibdir}/firebird.conf.rpmsave ]; then
@@ -280,15 +321,20 @@ fi
 %defattr(644,root,root,755)
 %doc doc/{license,sql.extensions,Firebird_conf.txt,README.user*,WhatsNew,fb2-todo.txt}
 %dir %{_sysconfdir}/firebird
+%dir %{_sysconfdir}/firebird/conf.d
 %attr(640,root,firebird) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/firebird/databases.conf
 %attr(640,root,firebird) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/firebird/fbtrace.conf
 %attr(640,root,firebird) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/firebird/firebird.conf
 %attr(640,root,firebird) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/firebird/plugins.conf
 %{_sysconfdir}/firebird/intl
+%{_sysconfdir}/firebird/UDF
+%{_sysconfdir}/firebird/bin
+%{_sysconfdir}/firebird/firebird.msg
+%{_sysconfdir}/firebird/plugins
+%attr(755,root,root) %{_bindir}/fb_isql
 %attr(755,root,root) %{_bindir}/fb_lock_print
 %attr(755,root,root) %{_bindir}/gbak
 %attr(755,root,root) %{_bindir}/gfix
-%attr(755,root,root) %{_bindir}/gpre
 %attr(755,root,root) %{_bindir}/gsec
 %attr(755,root,root) %{_bindir}/gsplit
 %attr(755,root,root) %{_bindir}/gstat
@@ -297,6 +343,8 @@ fi
 %attr(755,root,root) %{ibdir}/UDF
 %attr(755,root,root) %{ibdir}/bin/*
 %exclude %{ibdir}/bin/fb_config
+%exclude %{ibdir}/bin/gpre
+%exclude %{ibdir}/bin/fbguard
 %{ibdir}/help
 %dir %attr(770,root,firebird) %{ibdir}/intl
 %attr(755,root,root) %{ibdir}/intl/fbintl
@@ -320,13 +368,6 @@ fi
 %attr(660,root,firebird) %config(noreplace) %verify(not md5 mtime size) /var/lib/firebird/security3.fdb
 %attr(660,root,firebird) %config(noreplace) %verify(not md5 mtime size) /var/log/firebird.log
 
-%if %{with ss}
-%attr(754,root,root) /etc/rc.d/init.d/firebird
-%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/firebird
-%attr(770,root,firebird) /var/run/firebird
-%else
-%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/rc-inetd/firebird
-%endif
 
 %files dirs
 %defattr(644,root,root,755)
@@ -348,6 +389,8 @@ fi
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_libdir}/libfbclient.so
 %attr(755,root,root) %{ibdir}/bin/fb_config
+%attr(755,root,root) %{ibdir}/bin/gpre
+%attr(755,root,root) %{_bindir}/gpre
 %{_includedir}/firebird
 %{_includedir}/ib_util.h
 %{_includedir}/ibase.h
@@ -358,3 +401,20 @@ fi
 %files doc
 %defattr(644,root,root,755)
 %doc docs/*
+
+%files ss
+%defattr(644,root,root,755)
+%attr(640,root,firebird) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/firebird/conf.d/server_mode-ss.conf
+%attr(754,root,root) /etc/rc.d/init.d/firebird
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/firebird
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/tmpfiles.d/firebird.conf
+%attr(755,root,root) %{ibdir}/bin/fbguard
+%dir %attr(770,root,firebird) /var/run/firebird
+%{systemdunitdir}/firebird.service
+
+%files classic
+%defattr(644,root,root,755)
+%attr(640,root,firebird) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/firebird/conf.d/server_mode-classic.conf
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/rc-inetd/firebird
+%{systemdunitdir}/firebird-classic@.service
+%{systemdunitdir}/firebird-classic.socket
diff --git a/config.patch b/config.patch
new file mode 100644 (file)
index 0000000..c499651
--- /dev/null
@@ -0,0 +1,8 @@
+--- Firebird-3.0.2.32703-0/builds/install/misc/firebird.conf.in.orig   2017-03-21 10:11:35.000000000 +0100
++++ Firebird-3.0.2.32703-0/builds/install/misc/firebird.conf.in        2017-04-03 12:24:52.184150250 +0200
+@@ -919,3 +919,5 @@
+ # Type: string
+ #
+ #ServerMode = Super
++
++include conf.d/*.conf
diff --git a/firebird-classic.service b/firebird-classic.service
new file mode 100644 (file)
index 0000000..ed2562d
--- /dev/null
@@ -0,0 +1,13 @@
+[Unit]
+Description=Firebird Database Server ( Classic )
+After=local-fs.target
+
+[Service]
+User=firebird
+Group=firebird
+ExecStart=/usr/lib/interbase/bin/firebird -el /var/lib/firebird
+StandardInput=socket
+StandardError=syslog
+
+[Install]
+Also=firebird-classic.socket
diff --git a/firebird-classic.socket b/firebird-classic.socket
new file mode 100644 (file)
index 0000000..f8deb0c
--- /dev/null
@@ -0,0 +1,11 @@
+[Unit]
+Description=Firebird Classic Activation Socket
+Conflicts=firebird.service
+
+[Socket]
+ListenStream=3050
+Accept=true
+MaxConnections=2048
+
+[Install]
+WantedBy=sockets.target
diff --git a/firebird.service b/firebird.service
new file mode 100644 (file)
index 0000000..5633e51
--- /dev/null
@@ -0,0 +1,15 @@
+[Unit]
+Description=Firebird Database Server ( SuperServer )
+After=syslog.target network.target
+Conflicts=firebird-classic.socket
+
+[Service]
+User=firebird
+Group=firebird
+Type=forking
+PIDFile=/var/run/firebird/default.pid
+ExecStart=/usr/lib/interbase/bin/fbguard -pidfile /var/run/firebird/default.pid -daemon -forever
+StandardError=syslog
+
+[Install]
+WantedBy=multi-user.target
diff --git a/firebird.tmpfiles b/firebird.tmpfiles
new file mode 100644 (file)
index 0000000..c5b9866
--- /dev/null
@@ -0,0 +1 @@
+d /var/run/firebird 0770 root firebird -
diff --git a/server_mode-classic.conf b/server_mode-classic.conf
new file mode 100644 (file)
index 0000000..d7b7da1
--- /dev/null
@@ -0,0 +1,16 @@
+# ============================
+# Settings for Architecture Configuration
+# ============================
+
+#
+# Controls the method Firebird engine uses to work with databases and
+# related Firebird server startup parameters.
+#
+# The values are:
+# Classic / MultiProcess - for each attachment to server a separate process is started,
+#      each database may be opened by multiple processes (including local ones for
+#      embedded access), each attachment (process) has its own DB pages cache
+#
+# Type: string
+#
+ServerMode = Classic
diff --git a/server_mode-ss.conf b/server_mode-ss.conf
new file mode 100644 (file)
index 0000000..e5986cc
--- /dev/null
@@ -0,0 +1,18 @@
+# ============================
+# Settings for Architecture Configuration
+# ============================
+
+#
+# Controls the method Firebird engine uses to work with databases and
+# related Firebird server startup parameters.
+#
+# The values are:
+# Super / ThreadedDedicated - databases are opened exclusive by single server process,
+#      attachments share single DB pages cache inside process
+# SuperClassic / ThreadedShared - databases are opened by single server process,
+#      but it does not prevent opening them in other processes (embedded access),
+#      each attachment has its own DB pages cache
+#
+# Type: string
+#
+ServerMode = Super
This page took 0.09144 seconds and 4 git commands to generate.