Bug 476832 - (mydns) Review Request: mydns - serve DNS records directly from an SQL database
Review Request: mydns - serve DNS records directly from an SQL database
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: Package Review (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Mamoru TASAKA
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-17 07:41 EST by Itamar Reis Peixoto
Modified: 2009-08-03 23:34 EDT (History)
3 users (show)

See Also:
Fixed In Version: 1.2.8.25-1.fc10
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-02-26 14:35:04 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
mtasaka: fedora‑review+
tibbs: fedora‑cvs+


Attachments (Terms of Use)
proposal for scriptlets (1.68 KB, text/plain)
2009-02-05 11:59 EST, Mamoru TASAKA
no flags Details

  None (edit)
Description Itamar Reis Peixoto 2008-12-17 07:41:49 EST
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).
Comment 1 Itamar Reis Peixoto 2008-12-17 07:48:37 EST
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 ?
Comment 2 Mamoru TASAKA 2008-12-17 09:05:03 EST
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)
Comment 3 Itamar Reis Peixoto 2008-12-17 09:37:05 EST
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 ?
Comment 4 Mamoru TASAKA 2008-12-17 10:04:36 EST
(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.
Comment 5 Itamar Reis Peixoto 2009-01-23 09:56:25 EST
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
Comment 6 Itamar Reis Peixoto 2009-01-23 12:10:01 EST
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 ?
Comment 7 Mamoru TASAKA 2009-01-25 02:05:27 EST
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".
Comment 8 Itamar Reis Peixoto 2009-01-27 15:37:27 EST
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
Comment 9 Mamoru TASAKA 2009-01-27 15:55:20 EST
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....
Comment 10 Mamoru TASAKA 2009-01-29 14:49:35 EST
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)
Comment 11 Mamoru TASAKA 2009-01-29 14:55:24 EST
... 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.
Comment 12 Itamar Reis Peixoto 2009-01-30 08:53:48 EST
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 ?
Comment 13 Mamoru TASAKA 2009-01-30 12:29:18 EST
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.
Comment 14 Itamar Reis Peixoto 2009-01-30 13:21:21 EST
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.
Comment 15 Itamar Reis Peixoto 2009-02-02 10:25:20 EST
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.
Comment 16 Mamoru TASAKA 2009-02-02 10:49:01 EST
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.
Comment 18 Mamoru TASAKA 2009-02-04 13:37:09 EST
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?
Comment 19 Mamoru TASAKA 2009-02-04 13:38:12 EST
(In reply to comment #18)
>     ! Please stop daemon on removal (not upgrade, i.e. [ $! = 0 ])

This is [ $1 = 0 ]
Comment 20 Itamar Reis Peixoto 2009-02-04 22:41:13 EST
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
Comment 21 Mamoru TASAKA 2009-02-05 11:59:14 EST
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?
Comment 23 Mamoru TASAKA 2009-02-10 12:35:59 EST
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
------------------------------------------------------------
Comment 24 Itamar Reis Peixoto 2009-02-10 14:00:31 EST
(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:
Comment 25 Kevin Fenzi 2009-02-10 17:27:46 EST
cvs done.
Comment 26 Fedora Update System 2009-02-25 16:11:30 EST
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
Comment 27 Fedora Update System 2009-02-26 10:35:40 EST
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
Comment 28 Mamoru TASAKA 2009-02-26 14:35:04 EST
Now closing.
Comment 29 Fedora Update System 2009-03-05 11:34:03 EST
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.
Comment 30 Itamar Reis Peixoto 2009-08-03 22:45:38 EDT
Package Change Request
======================
Package Name: mydns
New Branches: EL-4 EL-5
Owners: itamarjp
Comment 31 Jason Tibbitts 2009-08-03 23:34:50 EDT
CVS done.

Note You need to log in before you can comment on or make changes to this bug.