Spec URL: SRPM URL: Description: MyDNS is a free DNS server for UNIX. It was implemented from scratch and is designed to serve records directly from an SQL database (currently either MySQL or PostgreSQL).
I need some help packaging mydns. at this moment mydns doesn't have loadable module support, so I need to compile mydns 2 times, one for mysql and another for postgresql support, something like this. mysql: %configure --without-pgsql --with-mysql --with-mysql-lib=%{_libdir}/mysql --with-mysql-include=%{_includedir}/mysql --with-zlib=%{_libdir} postgresql: %configure --with-pgsql --without-mysql --with-pgsql-lib=%{_libdir} --with-pgsql-include=%{_includedir} --with-zlib=%{_libdir} I like to create one base package and 2 subpackages mydns mydns-mysql mydns-postgresql but the problem is the name of the files. /usr/bin/mydns (in mysql subpackage) /usr/bin/mydns (in postgresql subpackage) what's the best way to package this ? renaming files ? /usr/bin/mydns-mysql (in mysql subpackage) /usr/bin/mydns-postgresql (in postgresql subpackage) or there are a way to preserve the mydns name in executable ?
It seems you forgot to write the URLs of your spec/srpm... Then some guess - If possible, renaming binaries' names (and writing some notes why you renamed the binaries as one document) is the simplest - If you want to keep "mydns" name, I guess for this case we can use alternatives method (still installed binaries themselves should be renamed)
the mydns-mysql can conflict with mydns-postgresql, so only one will installed and the use alternatives will not needed example. configure --with-mysql make mkdir mysql make install DESTDIR=mysql configure --with-postgresql make mkdir mysql make install DESTDIR=postgresql list files mysql/usr/sbin/mydns postgresql/usr/sbin/mydns is possible to package mysql/usr/sbin/mydns into mydns-mysql package and postgresql/usr/sbin/mydns into mydns-postgresql package ?
(In reply to comment #3) > the mydns-mysql can conflict with mydns-postgresql, so only one will installed > and the use alternatives will not needed - I guess in this case "Conflict" method should not be used and I guess perhaps other reviewers also complain about using Conflict: See: https://fedoraproject.org/wiki/Packaging/Conflicts#Conflicting_Files > example. > > configure --with-mysql > make > mkdir mysql > make install DESTDIR=mysql > > > configure --with-postgresql > make > mkdir mysql > make install DESTDIR=postgresql > > list files > > mysql/usr/sbin/mydns > postgresql/usr/sbin/mydns > > is possible to package mysql/usr/sbin/mydns into mydns-mysql package and > postgresql/usr/sbin/mydns into mydns-postgresql package ? - This is not possible. For now marking as NotReady.
please take a l@@k when you have time. http://ispbrasil.com.br/mydns/mydns.spec http://ispbrasil.com.br/mydns/mydns-1.2.8.18-1.fc10.src.rpm I am planning to use alternatives to make symlinks to postgresql or mysql binary's
We need to run this script for both mysql and pgsql subpackages after it's installed Can you help with this? /usr/sbin/alternatives --install /usr/sbin/mydns MyDNS /usr/sbin/mydns-pgsql 1 \ --slave /usr/bin/mydnscheck mydnscheck /usr/bin/mydnscheck-pgsql \ --slave /usr/bin/mydnsexport mydnsexport /usr/bin/mydnsexport-pgsql \ --slave /usr/bin/mydnsimport mydnsimport /usr/bin/mydnsimport-pgsql \ --slave /usr/bin/mydnsptrconvert mydnsptrconvert /usr/bin/mydnsptrconvert-pgsql Can I put the mysql sub-package to conflict with pgsql or it's a bad idea ?
The alternatives usage itself seems good (you can refer to postfix scriptlets. please check: $ rpm -q --scripts postfix) If alternatives method is used, declaring Conflicts should not be needed. - When using alternatives, both mysql and pgsql subpackages should be installed altogether as there should be no file conflicts. - It is not necessary that mysql and pgsql should have the same priority. Actually sysadmin has to choose which database to use, so anyway it is expected that sysadmin executes "alternatives --config".
new version with a working http://ispbrasil.com.br/mydns/mydns.spec http://ispbrasil.com.br/mydns/mydns-1.2.8.19-1.fc10.src.rpm Can you help to fix this rpmlint message ? [itamar@itamar mydns]$ rpmlint /home/itamar/rpmbuild/RPMS/x86_64/mydns-1.2.8.19-1.fc10.x86_64.rpm mydns.x86_64: E: postin-without-install-info /usr/share/info/mydns.info.gz mydns.x86_64: E: postin-without-install-info /usr/share/info/mydns.info.gz mydns.x86_64: E: no-binary mydns.x86_64: W: service-default-enabled /etc/rc.d/init.d/mydns 1 packages and 0 specfiles checked; 3 errors, 1 warnings. in special postin-without-install-info and service-default-enabled
Well, I have not checked your latest srpm at all, just answering your question: * postin-without-install-info - Please check: https://fedoraproject.org/wiki/Packaging/ScriptletSnippets#Texinfo i.e. texinfo .info files must be registered by install-info. * service-default-enabled - This is written on: https://fedoraproject.org/wiki/Packaging/SysVInitScript#.23_chkconfig:_line i.e. in contrib/mydns.redhat, the line # chkconfig: 345 52 50 should be: # chkconfig: - 52 50 Again I have not checked your latest srpm at all....
Some notes: * License - License tag should be GPLv2+. * %description place - Would you move the place of %package and %description to the upper side of %prep? * Documents - I guess it is better that QUICKSTART.mysql is installed in -mysql subpackage and QUICKSTART.postgres in -pgsql subpackage. - For HOWTO: -------------------------------------------------------------------- install -Dp -m 644 %{SOURCE1} %{_builddir}/%{name}-%{base_version} -------------------------------------------------------------------- * Move this to %prep section, if "HOWTO" file is not to be modified at %build. * By the way is HOWTO also needed for subpackages? * Current working directory -------------------------------------------------------------------- make install DESTDIR=%{_builddir}/%{name}-%{base_version}/mysql -------------------------------------------------------------------- - make install DESTDIR=$(pwd)/mysql is simpler. (at %build, %install (and %check) stage, the working directory is %{_builddir}/%{name}-%{base_version} in this case) For "install -Dp ....", even -------------------------------------------------------------------- install -Dp ./$database%{_bindir}/mydnscheck %{buildroot}%{_bindir}/mydnscheck-$database -------------------------------------------------------------------- can be used (for DESTDIR=, usually this should be absolute path) * CFLAGS -------------------------------------------------------------------- make CFLAGS="%{optflags}" %{?_smp_mflags} -------------------------------------------------------------------- - Would you check if this "CFLAGS=%{optflags}" is really needed? %configure sets CFLAGS environment variable and configure/Makefiles created from recent autotools honor this CFLAGS. * autotool recall -------------------------------------------------------------------- 644 + make 'CFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables' -j8 645 cd . && /bin/sh /builddir/build/BUILD/mydns-1.2.8/missing --run aclocal-1.10 -I m4 646 /builddir/build/BUILD/mydns-1.2.8/missing: line 46: aclocal-1.10: command not found 647 WARNING: `aclocal-1.10' is missing on your system. You should only need it if 648 you modified `acinclude.m4' or `configure.ac'. You might want 649 to install the `Automake' and `Perl' packages. Grab them from 650 any GNU archive site. 651 cd . && /bin/sh /builddir/build/BUILD/mydns-1.2.8/missing --run autoconf -------------------------------------------------------------------- - Here autotools are called automatically after calling make. This usually means that timestamps on some files are wrong. Please modify the timestamps of those to prevent autotool recall here. * Directory structure -------------------------------------------------------------------- install -Dp -m 644 contrib/admin.php %{buildroot}%{_datadir}/admin.php -------------------------------------------------------------------- - I don't think that putting files under %_datadir (not under the subdirectory of %_datadir) is a good idea. This should be moved to %{_datadir}/%{name}, for example. * gettext .po file - This package has gettext .po files under po/ directory and actually "make install" installs compiled .mo files. Please include gettext .mo file in binary rpm (and use %find_lang)
... and follows... * scriptlets - For SysV initscripts handling, please refer to https://fedoraproject.org/wiki/Packaging/SysVInitScript#InitscriptScriptlets (Note that there are some Requires(post) or so) - Add "Requires(post): %{_sbindir}/alternatives" (also Requires(preun)) for -mysql and -pgsql subpackages * And please also check my comment 9.
fixed. http://ispbrasil.com.br/mydns/mydns.spec http://ispbrasil.com.br/mydns/mydns-1.2.8.22-1.fc10.src.rpm I need only to replace this 2 command's by install instead using cp. mkdir -p %{buildroot}%{_datadir}/locale cp -a ./$database%{_datadir}/locale %{buildroot}%{_datadir} any suggestion about this ?
Well, > I need only to replace this 2 command's by install instead using cp. > > mkdir -p %{buildroot}%{_datadir}/locale > cp -a ./$database%{_datadir}/locale %{buildroot}%{_datadir} If "cp" can be used here, you can just use cp. I frequenty use both "install" and "cp" in one spec file. By the way for .22-1: * Working directory ---------------------------------------------------------- #install doc about alternatives install -Dp -m 644 %{SOURCE1} %{_builddir}/%{name}-%{base_version} ---------------------------------------------------------- - Well, even in %prep after %setup -q is finished, the working directory is %{_builddir}/%{name}-%{base_version} for this case. * Autotool recall - build.log says: ---------------------------------------------------------- 649 + make -j4 650 cd . && /bin/sh /builddir/build/BUILD/mydns-1.2.8/missing --run autoheader 651 /builddir/build/BUILD/mydns-1.2.8/missing: line 46: autoheader: command not found 652 WARNING: `autoheader' is missing on your system. You should only need it if 653 you modified `acconfig.h' or `configure.ac'. You might want 654 to install the `Autoconf' and `GNU m4' packages. Grab them 655 from any GNU archive site. 656 rm -f stamp-h1 657 touch config.h.in 658 cd . && /bin/sh ./config.status config.h 659 config.status: creating config.h 660 config.status: config.h is unchanged 661 make all-recursive ---------------------------------------------------------- Still autotools are called. Please suppress this. * cflags I didn't notice this before, however: ---------------------------------------------------------- 613 checking CFLAGS... -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -fomit-frame-pointer -finline-functions -ffast-math -funsigned-char ---------------------------------------------------------- - -fomit-frame-pointer is not allowed on Fedora because this makes debugging very difficult - Also -ffast-math should be avoid unless you have some reasons because this changes (decreases) the precision of math functions and introduces some assumption. * Scriptlets - As I said in my previous comment, please add proper Requires(post) or so. (In reply to comment #11) > * scriptlets > - For SysV initscripts handling, please refer to > https://fedoraproject.org/wiki/Packaging/SysVInitScript#InitscriptScriptlets > (Note that there are some Requires(post) or so) > > - Add "Requires(post): %{_sbindir}/alternatives" (also Requires(preun)) > for -mysql and -pgsql subpackages By the way: ----------------------------------------------------------- if [ $1 = 1 ]; then /sbin/chkconfig --add %{name} fi ----------------------------------------------------------- - if [ $1 = 1 ] is not needed. If service name is already registered in initscript symlinks, then chkconfig --add does nothing. Also, removing [ $1 = 1 ] can handle the case in which service name changes correctly. * Info file - I checked the info file and actually mydns.info.gz is empty (try gunzip). I guess some BuildRequires are missing (perhaps texinfo) * Directory ownership issue - %_datadir/%name is not owned by any packages. * Gettext .mo files - Making gettext .mo files owned by two subpackages is not needed. Please these files to pydns package.
I will add a new .spec tomorrow. I am planning to add a user and a group called mydns and make it own the file /etc/mydns.conf, so mydns.conf will not readable by everyone, since this file stores the user and password of mydns database connection.
most of the things fixed here. http://ispbrasil.com.br/mydns/mydns.spec http://ispbrasil.com.br/mydns/mydns-1.2.8.23-1.fc10.src.rpm ----------------- koji scratch build http://koji.fedoraproject.org/koji/taskinfo?taskID=1099426 but I am still don't understand why you trying to say about HOWTO file. #install doc about alternatives install -Dp -m 644 %{SOURCE1} %{_builddir}/%{name}-%{base_version} ---------------------------------------------------------- - Well, even in %prep after %setup -q is finished, the working directory is %{_builddir}/%{name}-%{base_version} for this case.
Again I have not checked your srpm at all, however: (In reply to comment #15) > but I am still don't understand why you trying to say about HOWTO file. > > > #install doc about alternatives > install -Dp -m 644 %{SOURCE1} %{_builddir}/%{name}-%{base_version} > ---------------------------------------------------------- > - Well, even in %prep after %setup -q is finished, the working directory > is %{_builddir}/%{name}-%{base_version} for this case. I am saying that ---------------------------------------------------- #install doc about alternatives install -Dp -m 644 %{SOURCE1} . ---------------------------------------------------- is simpler.
please look this version when you have time. http://ispbrasil.com.br/mydns/mydns.spec http://ispbrasil.com.br/mydns/mydns-1.2.8.23-2.fc10.src.rpm --------- koji http://koji.fedoraproject.org/koji/taskinfo?taskID=1099546
Now for 1.2.8.23-2: * Scriptlets - For user/group creation, please follow below: https://fedoraproject.org/wiki/Packaging/UsersAndGroups - Again please check https://fedoraproject.org/wiki/Packaging/SysVInitScript#Initscripts_in_spec_file_scriptlets ! Requires(preun): chkconfig, initscripts is missing (for initscripts dependency see below) ! Please stop daemon on removal (not upgrade, i.e. [ $! = 0 ]) * attr - For safety, please write %attr(0600,root,root) %config(noreplace) on %{_sysconfdir}/mydns.conf explicitly. ! By the way is it okay that this file is not readable even from mydns user/group?
(In reply to comment #18) > ! Please stop daemon on removal (not upgrade, i.e. [ $! = 0 ]) This is [ $1 = 0 ]
changed scriptlets new version here. http://ispbrasil.com.br/mydns/mydns.spec http://ispbrasil.com.br/mydns/mydns-1.2.8.23-3.fc11.src.rpm
Created attachment 331032 [details] proposal for scriptlets Well, about scriptlets: - When mydns is first installed: - For main package: - At pre, user/group must be registered. * "USERNAME" used here is wrong - At post, chkconfig, info must be called - After database subpackage is first installed: - At post, alternatives must be called - When mydns is upgraded: - For main package: - At post, chkconfig info must be called. - For database subpackage: - At post, alternatives must be called. - At postun: (here as this is "upgrading", $1 = 1) service mydns should be restared. - When removal: - When database subpackage is to be removed: - When the database to be removed is actually selected on alternatives, service must be stopped at preun - On the other hand, the other database is selected, there is no need that service should be stopped. - alternatives must be called at preun to unregister * service itself must not be removed on subpackage removal - When main package itself is to be removed - info must be unregistered at preun - For safety, I think stopping service also at preun of main package is reasonable - service must be unregistered at preun Note that I usually write "exit 0" at the end of the scriptlets to make it sure that scriptlets surely exit with success (even if some failure occured in the scriptlets) I attached the proposal for scriptlets. How do you think of this?
ok, done, http://ispbrasil.com.br/mydns/mydns.spec http://ispbrasil.com.br/mydns/mydns-1.2.8.25-1.fc10.src.rpm http://koji.fedoraproject.org/koji/taskinfo?taskID=1115863
Well, - I noticed that "info mydns" does not work (it actually shows mydns(8) man page) (although info -f /usr/share/info/mydns.info.gz shows mydns info page). It seems that mydns.texi file itself needs fixing, however I won't make this bug blocked by this issue. ------------------------------------------------------------ This package (mydns) is APPROVED by mtasaka ------------------------------------------------------------
(In reply to comment #23) I will add this to my TODO list. New Package CVS Request ======================= Package Name: mydns Short Description: Serve DNS records directly from an SQL database Owners: itamarjp Branches: F-10 InitialCC:
cvs done.
mydns-1.2.8.25-1.fc10 has been submitted as an update for Fedora 10. http://admin.fedoraproject.org/updates/mydns-1.2.8.25-1.fc10
mydns-1.2.8.25-1.fc10 has been pushed to the Fedora 10 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update mydns'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-2135
Now closing.
mydns-1.2.8.25-1.fc10 has been pushed to the Fedora 10 stable repository. If problems still persist, please make note of it in this bug report.
Package Change Request ====================== Package Name: mydns New Branches: EL-4 EL-5 Owners: itamarjp
CVS done.