Bug 476832 (mydns) - Review Request: mydns - serve DNS records directly from an SQL database
Summary: Review Request: mydns - serve DNS records directly from an SQL database
Keywords:
Status: CLOSED NEXTRELEASE
Alias: mydns
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Mamoru TASAKA
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-12-17 12:41 UTC by Itamar Reis Peixoto
Modified: 2009-08-04 03:34 UTC (History)
3 users (show)

Fixed In Version: 1.2.8.25-1.fc10
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-02-26 19:35:04 UTC
Type: ---
Embargoed:
mtasaka: fedora-review+
j: fedora-cvs+


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

Description Itamar Reis Peixoto 2008-12-17 12:41:49 UTC
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 12:48:37 UTC
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 14:05:03 UTC
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 14:37:05 UTC
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 15:04:36 UTC
(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 14:56:25 UTC
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 17:10:01 UTC
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 07:05:27 UTC
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 20:37:27 UTC
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 20:55:20 UTC
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 19:49:35 UTC
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 19:55:24 UTC
... 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 13:53:48 UTC
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 17:29:18 UTC
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 18:21:21 UTC
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 15:25:20 UTC
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 15:49:01 UTC
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 18:37:09 UTC
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 18:38:12 UTC
(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-05 03:41:13 UTC
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 16:59:14 UTC
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 17:35:59 UTC
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 19:00:31 UTC
(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 22:27:46 UTC
cvs done.

Comment 26 Fedora Update System 2009-02-25 21:11:30 UTC
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 15:35:40 UTC
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 19:35:04 UTC
Now closing.

Comment 29 Fedora Update System 2009-03-05 16:34:03 UTC
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-04 02:45:38 UTC
Package Change Request
======================
Package Name: mydns
New Branches: EL-4 EL-5
Owners: itamarjp

Comment 31 Jason Tibbitts 2009-08-04 03:34:50 UTC
CVS done.


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