Discussion:
Please help translate old rules file on the installation rules
T o n g
2014-07-12 03:51:24 UTC
Permalink
Hi,

I used the `dh_make` to create a new rules file, but found that what I
want to install are not in the final package.

Here is what the old rules file looks like:

install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs

install -m 755 ddclient \
$(DESTDIR)/usr/sbin/ddclient

install -D -m 755 debian/ddclient.NetworkManager \
$(DESTDIR)/etc/NetworkManager/dispatcher.d/50-ddclient


Here is my tweaked new rules file:

# main packaging script based on dh7 syntax
%:
dh $@

override_dh_auto_install:
install -m 755 ddclient \
$(DESTDIR)/usr/sbin/ddclient

install -D -m 755 debian/ddclient.NetworkManager \
$(DESTDIR)/etc/NetworkManager/dispatcher.d/50-ddclient


Apparently my tweaking is not achieving what I'm expecting.

How to make it work please?
Both rules files are posted in full at
http://paste.debian.net/109275/ and http://paste.debian.net/109276/

Thanks

tong



--
To UNSUBSCRIBE, email to debian-mentors-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: https://lists.debian.org/lpqbbr$grb$***@ger.gmane.org
Vincent Bernat
2014-07-12 07:27:32 UTC
Permalink
❊ 12 juillet 2014 03:51 GMT, T o n g <***@yahoo.com> :

> # main packaging script based on dh7 syntax
> %:
> dh $@
>
> override_dh_auto_install:
> install -m 755 ddclient \
> $(DESTDIR)/usr/sbin/ddclient
>
> install -D -m 755 debian/ddclient.NetworkManager \
> $(DESTDIR)/etc/NetworkManager/dispatcher.d/50-ddclient

You need to add dh_auto_install to the set of commands to execute in
this target.
--
panic("IRQ, you lose...");
2.2.16 /usr/src/linux/arch/mips/sgi/kernel/indy_int.c
T o n g
2014-07-12 13:14:23 UTC
Permalink
On Sat, 12 Jul 2014 09:27:32 +0200, Vincent Bernat wrote:

>> # main packaging script based on dh7 syntax %:
>> dh $@
>>
>> override_dh_auto_install:
>> install -m 755 ddclient \
>> $(DESTDIR)/usr/sbin/ddclient
>>
>> install -D -m 755 debian/ddclient.NetworkManager \
>> $(DESTDIR)/etc/NetworkManager/dispatcher.d/50-ddclient
>
> You need to add dh_auto_install to the set of commands to execute in
> this target.

Oh, I though "override_dh_auto_install" is the way to add dh_auto_install
to the set of commands, No?

You mean to rename my "override_dh_auto_install" to "dh_auto_install"
instead? Do I also need to take care of the following in it as well?

dh_testdir
dh_testroot
dh_clean -k
dh_installdirs





--
To UNSUBSCRIBE, email to debian-mentors-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: https://lists.debian.org/lprcbf$dos$***@ger.gmane.org
T o n g
2014-07-12 13:23:16 UTC
Permalink
On Sat, 12 Jul 2014 13:14:23 +0000, T o n g wrote:

>>> # main packaging script based on dh7 syntax %:
>>> dh $@
>>>
>>> override_dh_auto_install:
>>> install -m 755 ddclient \
>>> $(DESTDIR)/usr/sbin/ddclient
>>>
>>> install -D -m 755 debian/ddclient.NetworkManager \
>>> $(DESTDIR)/etc/NetworkManager/dispatcher.d/50-ddclient
>>
>> You need to add dh_auto_install to the set of commands to execute in
>> this target.
>
> Oh, I though "override_dh_auto_install" is the way to add
> dh_auto_install to the set of commands, No?

Oh, did you mean this:

override_dh_auto_install:
install -m 755 ddclient \
$(DESTDIR)/usr/sbin/ddclient

install -D -m 755 debian/ddclient.NetworkManager \
$(DESTDIR)/etc/NetworkManager/dispatcher.d/50-ddclient
dh_auto_install

The command dh_auto_install is added to the end. But they are still not
show up in the final package.



--
To UNSUBSCRIBE, email to debian-mentors-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: https://lists.debian.org/lprcs4$dos$***@ger.gmane.org
T o n g
2014-07-12 13:28:23 UTC
Permalink
On Sat, 12 Jul 2014 13:23:16 +0000, T o n g wrote:

> override_dh_auto_install:
> install -m 755 ddclient \
> $(DESTDIR)/usr/sbin/ddclient
>
> install -D -m 755 debian/ddclient.NetworkManager \
> $(
)/etc/NetworkManager/dispatcher.d/50-ddclient
> dh_auto_install
>
> The command dh_auto_install is added to the end. But they are still not
> show up in the final package.

I saw in the log,

...
dh_installdirs
debian/rules override_dh_auto_install
make[1]: Entering directory '/export/build/pkg/ddclient/bld/
ddclient-3.8.2'
install -m 755 ddclient \
/usr/sbin/ddclient
install -D -m 755 debian/ddclient.NetworkManager \
/etc/NetworkManager/dispatcher.d/50-ddclient
dh_auto_install
make[1]: Leaving directory '/export/build/pkg/ddclient/bld/ddclient-3.8.2'
dh_installdocs
...

Seems to me that DESTDIR is empty. Wouldn't dh_make/debuild set DESTDIR
at the beginning of the build?

Thanks


--
To UNSUBSCRIBE, email to debian-mentors-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: https://lists.debian.org/lprd5n$dos$***@ger.gmane.org
Andrey Rahmatullin
2014-07-13 12:18:21 UTC
Permalink
On Sat, Jul 12, 2014 at 01:28:23PM +0000, T o n g wrote:
> > override_dh_auto_install:
> > install -m 755 ddclient \
> > $(DESTDIR)/usr/sbin/ddclient
> >
> > install -D -m 755 debian/ddclient.NetworkManager \
> > $(
> )/etc/NetworkManager/dispatcher.d/50-ddclient
> > dh_auto_install
> >
> > The command dh_auto_install is added to the end. But they are still not
> > show up in the final package.
>
> I saw in the log,
>
> ...
> dh_installdirs
> debian/rules override_dh_auto_install
> make[1]: Entering directory '/export/build/pkg/ddclient/bld/
> ddclient-3.8.2'
> install -m 755 ddclient \
> /usr/sbin/ddclient
> install -D -m 755 debian/ddclient.NetworkManager \
> /etc/NetworkManager/dispatcher.d/50-ddclient
> dh_auto_install
> make[1]: Leaving directory '/export/build/pkg/ddclient/bld/ddclient-3.8.2'
> dh_installdocs
> ...
>
> Seems to me that DESTDIR is empty. Wouldn't dh_make/debuild set DESTDIR
> at the beginning of the build?
Neither dh_make (which, by the way, is not run during the build process at
all), nor debuild set DESTDIR. DESTDIR is passed to make install when (and
if) dh_auto_install invokes it.
The old rules file sets it explicitly which is why the old code works.

--
WBR, wRAR
T o n g
2014-07-13 13:47:54 UTC
Permalink
On Sun, 13 Jul 2014 18:18:21 +0600, Andrey Rahmatullin wrote:

>> I saw in the log,
>>
>> ...
>> dh_installdirs
>> debian/rules override_dh_auto_install
>> make[1]: Entering directory '/export/build/pkg/ddclient/bld/
>> ddclient-3.8.2'
>> install -m 755 ddclient \
>> /usr/sbin/ddclient
>> install -D -m 755 debian/ddclient.NetworkManager \
>> /etc/NetworkManager/dispatcher.d/50-ddclient
>> dh_auto_install make[1]: Leaving directory
>> '/export/build/pkg/ddclient/bld/ddclient-3.8.2'
>> dh_installdocs ...
>>
>> Seems to me that DESTDIR is empty. Wouldn't dh_make/debuild set DESTDIR
>> at the beginning of the build?
>
> Neither dh_make (which, by the way, is not run during the build process
> at all), nor debuild set DESTDIR. DESTDIR is passed to make install when
> (and if) dh_auto_install invokes it.

Good to know. Regardless the internal details on how things are passed
along beneath the surface, how to fix it so that my debian/rules works
and my built package is not empty?

Again, here is my tweaked new rules file:

---------------------
# main packaging script based on dh7 syntax
%:
dh $@

override_dh_auto_install:
install -m 755 ddclient \
$(DESTDIR)/usr/sbin/ddclient

install -D -m 755 debian/ddclient.NetworkManager \
$(DESTDIR)/etc/NetworkManager/dispatcher.d/50-ddclient
dh_auto_install
---------------------




--
To UNSUBSCRIBE, email to debian-mentors-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: https://lists.debian.org/lpu2ma$c5h$***@ger.gmane.org
Andrey Rahmatullin
2014-07-13 12:19:08 UTC
Permalink
On Sat, Jul 12, 2014 at 03:51:24AM +0000, T o n g wrote:
> Hi,
>
> I used the `dh_make` to create a new rules file, but found that what I
> want to install are not in the final package.
>
> Here is what the old rules file looks like:
>
> install: build
> dh_testdir
> dh_testroot
> dh_clean -k
> dh_installdirs
>
> install -m 755 ddclient \
> $(DESTDIR)/usr/sbin/ddclient
>
> install -D -m 755 debian/ddclient.NetworkManager \
> $(DESTDIR)/etc/NetworkManager/dispatcher.d/50-ddclient
Note that you can achieve the same using dh_install(1) and probably
dh_installdirs(1), without writing override code.

--
WBR, wRAR
T o n g
2014-07-13 13:37:52 UTC
Permalink
On Sun, 13 Jul 2014 18:19:08 +0600, Andrey Rahmatullin wrote:

>> I used the `dh_make` to create a new rules file, but found that what I
>> want to install are not in the final package.
>>
>> Here is what the old rules file looks like:
>>
>> install: build
>> dh_testdir dh_testroot dh_clean -k dh_installdirs
>>
>> install -m 755 ddclient \
>> $(DESTDIR)/usr/sbin/ddclient
>>
>> install -D -m 755 debian/ddclient.NetworkManager \
>> $(DESTDIR)/etc/NetworkManager/dispatcher.d/50-ddclient
>
> Note that you can achieve the same using dh_install(1) and probably
> dh_installdirs(1), without writing override code.

Did you mean this in debian/rules?

---------------------------
# main packaging script based on dh7 syntax
%:
dh $@

dh_install:
install -m 755 ddclient \
$(DESTDIR)/usr/sbin/ddclient

install -D -m 755 debian/ddclient.NetworkManager \
$(DESTDIR)/etc/NetworkManager/dispatcher.d/50-ddclient

---------------------------

I tried the above and it didn't work.

Or, did you actually mean that I should not to define the rule for
'dh_install' but one of the following?

dh_installdirs
dh_auto_install
dh_installdocs
dh_installchangelogs
dh_installexamples
dh_installman
dh_installdebconf
dh_installinit
dh_installppp

The problem is that none seems to fit. The 'dh_installdebconf' seems
vaguely fit for the second install, but I'm really not sure.

Thanks


--
To UNSUBSCRIBE, email to debian-mentors-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: https://lists.debian.org/lpu23f$c5h$***@ger.gmane.org
Andrey Rahmatullin
2014-07-13 16:29:37 UTC
Permalink
On Sun, Jul 13, 2014 at 01:37:52PM +0000, T o n g wrote:
> > Note that you can achieve the same using dh_install(1) and probably
> > dh_installdirs(1), without writing override code.
>
> Did you mean this in debian/rules?
>
> ---------------------------
> # main packaging script based on dh7 syntax
> %:
> dh $@
>
> dh_install:
dh_install(1) is a program, not a target.

> install -m 755 ddclient \
> $(DESTDIR)/usr/sbin/ddclient
>
> install -D -m 755 debian/ddclient.NetworkManager \
> $(DESTDIR)/etc/NetworkManager/dispatcher.d/50-ddclient
Writing proper *.install would be enough.

--
WBR, wRAR
T o n g
2014-07-13 22:20:44 UTC
Permalink
On Sun, 13 Jul 2014 22:29:37 +0600, Andrey Rahmatullin wrote:

> dh_install(1) is a program, not a target.
>
>> install -m 755 ddclient \
>> $(DESTDIR)/usr/sbin/ddclient
>>
>> install -D -m 755 debian/ddclient.NetworkManager \
>> $(DESTDIR)/etc/NetworkManager/dispatcher.d/50-ddclient
> Writing proper *.install would be enough.

Please point me to where I can do further reading on this (exact url
appreciated), because I've spent a lot of time find it myself but haven't
found how to do it yet. Or -- an example is better than a thousand words.

Thanks



--
To UNSUBSCRIBE, email to debian-mentors-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: https://lists.debian.org/lpv0nr$c5h$***@ger.gmane.org
Ross Gammon
2014-07-13 22:26:22 UTC
Permalink
On 07/14/2014 12:20 AM, T o n g wrote:
> On Sun, 13 Jul 2014 22:29:37 +0600, Andrey Rahmatullin wrote:
>
>> dh_install(1) is a program, not a target.
>>
>>> install -m 755 ddclient \ $(DESTDIR)/usr/sbin/ddclient
>>>
>>> install -D -m 755 debian/ddclient.NetworkManager \
>>> $(DESTDIR)/etc/NetworkManager/dispatcher.d/50-ddclient
>> Writing proper *.install would be enough.
>
> Please point me to where I can do further reading on this (exact
> url appreciated), because I've spent a lot of time find it myself
> but haven't found how to do it yet. Or -- an example is better than
> a thousand words.
>
> Thanks
>

https://www.debian.org/doc/manuals/maint-guide/dother.en.html#install
T o n g
2014-07-14 04:06:16 UTC
Permalink
On Mon, 14 Jul 2014 00:26:22 +0200, Ross Gammon wrote:

>> On Sun, 13 Jul 2014 22:29:37 +0600, Andrey Rahmatullin wrote:
>>
>>> dh_install(1) is a program, not a target.
>>>
>>>> install -m 755 ddclient \ $(DESTDIR)/usr/sbin/ddclient
>>>>
>>>> install -D -m 755 debian/ddclient.NetworkManager \
>>>> $(DESTDIR)/etc/NetworkManager/dispatcher.d/50-ddclient
>>> Writing proper *.install would be enough.
>>
>> Please point me to where I can do further reading on this (exact url
>> appreciated), because I've spent a lot of time find it myself but
>> haven't found how to do it yet. Or -- an example is better than a
>> thousand words.
>>
> https://www.debian.org/doc/manuals/maint-guide/dother.en.html#install

On reviewing it, I think it won't solve my problem, because as said
before, I saw in the log,

...
dh_installdirs
debian/rules override_dh_auto_install
make[1]: Entering directory '/export/build/pkg/ddclient/bld/
ddclient-3.8.2'
install -m 755 ddclient \
/usr/sbin/ddclient
install -D -m 755 debian/ddclient.NetworkManager \
/etc/NetworkManager/dispatcher.d/50-ddclient
dh_auto_install
make[1]: Leaving directory '/export/build/pkg/ddclient/bld/ddclient-3.8.2'
dh_installdocs
...

I.e., the problem is that DESTDIR is empty. so $(DESTDIR)/usr/sbin/
ddclient becomes /usr/sbin/ddclient. Having a install file won't fix this
problem I am afraid.

Comments?

Thanks




--
To UNSUBSCRIBE, email to debian-mentors-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: https://lists.debian.org/lpvkvo$c5h$***@ger.gmane.org
Andrey Rahmatullin
2014-07-14 08:10:47 UTC
Permalink
On Mon, Jul 14, 2014 at 04:06:16AM +0000, T o n g wrote:
> >>> dh_install(1) is a program, not a target.
> >>>
> >>>> install -m 755 ddclient \ $(DESTDIR)/usr/sbin/ddclient
> >>>>
> >>>> install -D -m 755 debian/ddclient.NetworkManager \
> >>>> $(DESTDIR)/etc/NetworkManager/dispatcher.d/50-ddclient
> >>> Writing proper *.install would be enough.
> >>
> >> Please point me to where I can do further reading on this (exact url
> >> appreciated), because I've spent a lot of time find it myself but
> >> haven't found how to do it yet. Or -- an example is better than a
> >> thousand words.
> >>
> > https://www.debian.org/doc/manuals/maint-guide/dother.en.html#install
>
> On reviewing it, I think it won't solve my problem, because as said
> before, I saw in the log,
>
> ...
> dh_installdirs
> debian/rules override_dh_auto_install
> make[1]: Entering directory '/export/build/pkg/ddclient/bld/
> ddclient-3.8.2'
> install -m 755 ddclient \
> /usr/sbin/ddclient
> install -D -m 755 debian/ddclient.NetworkManager \
> /etc/NetworkManager/dispatcher.d/50-ddclient
> dh_auto_install
> make[1]: Leaving directory '/export/build/pkg/ddclient/bld/ddclient-3.8.2'
> dh_installdocs
> ...
>
> I.e., the problem is that DESTDIR is empty. so $(DESTDIR)/usr/sbin/
> ddclient becomes /usr/sbin/ddclient. Having a install file won't fix this
> problem I am afraid.
You don't need to pass the package directory, as $(DESTDIR) or in any
other form, when you use dh_install.


--
WBR, wRAR
T o n g
2014-07-14 04:17:51 UTC
Permalink
On Mon, 14 Jul 2014 04:06:16 +0000, T o n g wrote:

> On Mon, 14 Jul 2014 00:26:22 +0200, Ross Gammon wrote:
>
>>> On Sun, 13 Jul 2014 22:29:37 +0600, Andrey Rahmatullin wrote:
>>>
>>>> dh_install(1) is a program, not a target.
>>>>
>>>>> install -m 755 ddclient \ $(DESTDIR)/usr/sbin/ddclient
>>>>>
>>>>> install -D -m 755 debian/ddclient.NetworkManager \
>>>>> $(DESTDIR)/etc/NetworkManager/dispatcher.d/50-ddclient
>>>> Writing proper *.install would be enough.
>>>
>>> Please point me to where I can do further reading on this (exact url
>>> appreciated), because I've spent a lot of time find it myself but
>>> haven't found how to do it yet. Or -- an example is better than a
>>> thousand words.
>>>
>> https://www.debian.org/doc/manuals/maint-guide/dother.en.html#install
>
> On reviewing it, I think it won't solve my problem, because as said
> before, I saw in the log,
>
> ...
> dh_installdirs debian/rules override_dh_auto_install
> make[1]: Entering directory '/export/build/pkg/ddclient/bld/
> ddclient-3.8.2'
> install -m 755 ddclient \
> /usr/sbin/ddclient
> install -D -m 755 debian/ddclient.NetworkManager \
> /etc/NetworkManager/dispatcher.d/50-ddclient
> dh_auto_install make[1]: Leaving directory
> '/export/build/pkg/ddclient/bld/ddclient-3.8.2'
> dh_installdocs ...
>
> I.e., the problem is that DESTDIR is empty. so $(DESTDIR)/usr/sbin/
> ddclient becomes /usr/sbin/ddclient. Having a install file won't fix
> this problem I am afraid.

Hmm... I maybe wrong. But I'd rather fix my rules file instead of using
the install file, because there is no way to control the file mode, and
moreover, "You should first check there is not a more specific tool to
use. For example, documents should be in the docs file and not in this
one".

Thanks



--
To UNSUBSCRIBE, email to debian-mentors-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: https://lists.debian.org/lpvllf$c5h$***@ger.gmane.org
Andrey Rahmatullin
2014-07-14 08:11:27 UTC
Permalink
On Mon, Jul 14, 2014 at 04:17:51AM +0000, T o n g wrote:
> >>>> dh_install(1) is a program, not a target.
> >>>>
> >>>>> install -m 755 ddclient \ $(DESTDIR)/usr/sbin/ddclient
> >>>>>
> >>>>> install -D -m 755 debian/ddclient.NetworkManager \
> >>>>> $(DESTDIR)/etc/NetworkManager/dispatcher.d/50-ddclient
> >>>> Writing proper *.install would be enough.
> >>>
> >>> Please point me to where I can do further reading on this (exact url
> >>> appreciated), because I've spent a lot of time find it myself but
> >>> haven't found how to do it yet. Or -- an example is better than a
> >>> thousand words.
> >>>
> >> https://www.debian.org/doc/manuals/maint-guide/dother.en.html#install
> >
> > On reviewing it, I think it won't solve my problem, because as said
> > before, I saw in the log,
> >
> > ...
> > dh_installdirs debian/rules override_dh_auto_install
> > make[1]: Entering directory '/export/build/pkg/ddclient/bld/
> > ddclient-3.8.2'
> > install -m 755 ddclient \
> > /usr/sbin/ddclient
> > install -D -m 755 debian/ddclient.NetworkManager \
> > /etc/NetworkManager/dispatcher.d/50-ddclient
> > dh_auto_install make[1]: Leaving directory
> > '/export/build/pkg/ddclient/bld/ddclient-3.8.2'
> > dh_installdocs ...
> >
> > I.e., the problem is that DESTDIR is empty. so $(DESTDIR)/usr/sbin/
> > ddclient becomes /usr/sbin/ddclient. Having a install file won't fix
> > this problem I am afraid.
>
> Hmm... I maybe wrong. But I'd rather fix my rules file instead of using
> the install file, because there is no way to control the file mode,
Usually this is not a problem.

> moreover, "You should first check there is not a more specific tool to
> use. For example, documents should be in the docs file and not in this
> one".
Did you do that?

--
WBR, wRAR
Loading...