Re: Re: Specifying %{variable} in control file for use in post inst?

2011-06-11 Thread Amit Raj Gupta
Hi,

I have a compiled kernel module for the specific kernel version and I want to 
create a deb package for it. I want to run depmod -aeF /boot/System.map-$kvers 
$kvers in postinst script. How can I define kvers in control file and access 
it in postinst script? I am using cons to compile the kernel module and I can't 
use make, as my source tree don't have any make files.

Thanks,
Amit Raj Gupta

Re: Specifying %{variable} in control file for use in post inst?

2010-04-30 Thread Thomas Goirand




Ignacio Valdes wrote:

  On Thu, Apr 29, 2010 at 9:03 PM, Thomas Goirand tho...@goirand.fr wrote:
  
  
Ignacio Valdes wrote:


  It is a very complex, large package.
Does anyone know the mechanics of doing introspection in postinst for
the control file defined variables?

  

Exactly why the postinst generation method that has been given as a
(pretty good) solution would not work?

  
  
Required to produce versions for both rpm and deb.  No introspection
means not easy to convert this from rpm to deb which is where this
started.  This would make it much easier to produce both deb and rpm
versions if it has the ability to introspect those variables.

-- IV
  

Here's what you could do:

DEBVERS=head -n 1 debian/changelog | cut -d'(' -f2 | cut -d')' -f1 |
cut -d'-' -f1
sed -i "s/__VERSION__/${DEBVERS}/" mypackage.spec
sed "s/__VERSION__/${DEBVERS}/" debian/master.postinst
debian/postinst

This way, you are controlling the version variables of both your RPM
and your
Debian package using what's in the debian/changelog.

Then, if you have some of your postinst script that is the same in both
OS,
then you might want to have an OS independent script in a place like
/usr/share/PKGNAME/myscript, then just source it from spec file /
postinst.

I don't see this as being so hard...

To my experience, it's a lot more easy to be able to maintain BOTH the
rpm
and the Debian package rather than just porting from one to another. If
you
want to avoid redundancy and want to factor things a bit. Maybe you
could
suggest some modifications to the maintainer of the RPM package so you
can share changes with him later on.

Just my 2 cents, hoping it helped.

Thomas





-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4bdabf89.8080...@goirand.fr



Re: Specifying %{variable} in control file for use in post inst?

2010-04-30 Thread Ignacio Valdes
On Fri, Apr 30, 2010 at 6:45 AM, Thomas Goirand tho...@goirand.fr 
To my experience, it's a lot more easy to be able to maintain BOTH the
rpm
 and the Debian package rather than just porting from one to another. If you
 want to avoid redundancy and want to factor things a bit. Maybe you could
 suggest some modifications to the maintainer of the RPM package so you
 can share changes with him later on.

That is pretty much what I have been doing. But how about something as
simple as accomplishing this in postinst using the control file
variables?

echo The package: %{Package}-%{Version} is now installed.

How would one accomplish this in deb?

-- IV


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/r2t311679a81004300548z2176038ey4ccff3dad8d52...@mail.gmail.com



Re: Specifying %{variable} in control file for use in post inst?

2010-04-30 Thread Boyd Stephen Smith Jr.
On Friday 30 April 2010 07:48:59 Ignacio Valdes wrote:
 That is pretty much what I have been doing. But how about something as
 simple as accomplishing this in postinst using the control file
 variables?
 
 echo The package: %{Package}-%{Version} is now installed.
 
 How would one accomplish this in deb?

You wouldn't.  It's a useless message.  Drop it.
-- 
Boyd Stephen Smith Jr.   ,= ,-_-. =.
b...@iguanasuicide.net  ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-'
http://iguanasuicide.net/\_/


signature.asc
Description: This is a digitally signed message part.


Re: Specifying %{variable} in control file for use in post inst?

2010-04-30 Thread Goswin von Brederlow
Ignacio Valdes ival...@hal-pc.org writes:

 On Fri, Apr 30, 2010 at 6:45 AM, Thomas Goirand tho...@goirand.fr 
 To my experience, it's a lot more easy to be able to maintain BOTH the
 rpm
 and the Debian package rather than just porting from one to another. If you
 want to avoid redundancy and want to factor things a bit. Maybe you could
 suggest some modifications to the maintainer of the RPM package so you
 can share changes with him later on.

 That is pretty much what I have been doing. But how about something as
 simple as accomplishing this in postinst using the control file
 variables?

 echo The package: %{Package}-%{Version} is now installed.

 How would one accomplish this in deb?

Dpkg already does that. It would be wastefull to repeat it.

MfG
Goswin


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/87y6g5dm32@frosties.localdomain



Re: Specifying %{variable} in control file for use in post inst?

2010-04-30 Thread Kris Deugau

Ignacio Valdes wrote:

Required to produce versions for both rpm and deb.  No introspection
means not easy to convert this from rpm to deb which is where this
started.  This would make it much easier to produce both deb and rpm
versions if it has the ability to introspect those variables.


If all you're looking to do is produce .rpm and .deb package files for 
distribution from your own site, you might want to see if a script I 
wrote will meet your needs:


http://deepnet.cx/debbuild/

It takes a .spec and creates a .deb package file.

Please note:  it does **NOT** create a Debian package, it creates a .deb 
package that should install reasonably sanely on Debian and derivative 
systems.


Someday I'd like to expand it to write Debian packaging metadata that 
regular Debian packaging tools can use, but that's not happening any 
time soon.


-kgd


--
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4bdaf91b.2090...@vianet.ca



Re: Specifying %{variable} in control file for use in post inst?

2010-04-30 Thread Ignacio Valdes
rpm doesn't. I am going through the joy of trying to reconcile the two
systems so as to not have two divergent code bases as much as
possible.

-- IV

On Fri, Apr 30, 2010 at 9:57 AM, Goswin von Brederlow goswin-...@web.de wrote:

 echo The package: %{Package}-%{Version} is now installed.

 How would one accomplish this in deb?

 Dpkg already does that. It would be wastefull to repeat it.

 MfG
        Goswin


--
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/x2u311679a81004300903h2ce33eeey35ce5a30ae4cf...@mail.gmail.com



Re: Specifying %{variable} in control file for use in post inst?

2010-04-30 Thread Bernhard R. Link
* Ignacio Valdes ival...@hal-pc.org [100430 18:04]:
 rpm doesn't. I am going through the joy of trying to reconcile the two
 systems so as to not have two divergent code bases as much as
 possible.

Sorry to say it that harsh: I doubt anyone here will be able to help
you. We are focused on doing high-quality Debian packages. As you have
another goal, most people here will not even understand what your
problems are.
If you make Debian packages other people are supposed to use, please
consider doing proper postinst scripts that are targeted at Debian.
Even for different versions of Debian, postinst scripts may need to
differ a lot. I see no hope at all that anything that also works
elsewhere has any chance to be a proper postinst script. (If you have
some package specific tasks, consider creating some common helper
scripts to be called from the package scripts. That has the additional
advantage that users can also run them manually if needed).

Hochachtungsvoll,
Bernhard R. Link


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/20100430161512.ga15...@pcpool00.mathematik.uni-freiburg.de



Re: Specifying %{variable} in control file for use in post inst?

2010-04-30 Thread Thomas Goirand
Ignacio Valdes wrote:
 rpm doesn't. I am going through the joy of trying to reconcile the two
 systems so as to not have two divergent code bases as much as
 possible.

 -- IV
   
And I can't believe that any policy for any RPM based distro is advising to
print such useless information. IMHO, this echo should be removed from
the RPM version as well.

Thomas


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4bdb06cd.7050...@goirand.fr



Re: Specifying %{variable} in control file for use in post inst?

2010-04-29 Thread Ignacio Valdes
So what is the usual method of accessing control file values such as
Package: in postinst?

What is the usual method of accessing user-defined control file values
such as XC-branding in postinst?

I would have presume that using variables such as %{Package} or
%{branding} in postinst would have done it but it does not.

-- IV

On Sun, Apr 25, 2010 at 4:37 AM, Goswin von Brederlow goswin-...@web.de wrote:
 Ignacio Valdes ival...@hal-pc.org writes:

 Hi, I want to define a variable such as package_initials in control
 file and be able to access %{package_initials} in postinst file. Do I
 define it in control file as:

 XC-package_initials: the_initials

 or some other way?

 -- IV

 mv debian/postinst debian/postinst.in

 and in rules do

        sed 's/%{package_initials}/initials/g'  debian/postinst.in  
 debian/pkg.postinst

 MfG
        Goswin



--
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/r2i311679a81004291342m50290925g43982017d51ba...@mail.gmail.com



Re: Specifying %{variable} in control file for use in post inst?

2010-04-29 Thread Russ Allbery
Ignacio Valdes ival...@hal-pc.org writes:

 So what is the usual method of accessing control file values such as
 Package: in postinst?

Generally, you don't, since generally there's no reason to do so.  I can't
say I've ever had any reason to want to do that in any of the Debian
packages I maintain.

If you do need that information, substituting it into the postinst during
the package build is the way to go.

 What is the usual method of accessing user-defined control file values
 such as XC-branding in postinst?

Debian generally does not use user-defined control file values.

-- 
Russ Allbery (r...@debian.org)   http://www.eyrie.org/~eagle/


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/87k4rqoufk@windlord.stanford.edu



Re: Specifying %{variable} in control file for use in post inst?

2010-04-29 Thread Ignacio Valdes
On Thu, Apr 29, 2010 at 3:55 PM, Russ Allbery r...@debian.org wrote:
 Ignacio Valdes ival...@hal-pc.org writes:

 So what is the usual method of accessing control file values such as
 Package: in postinst?

 Generally, you don't, since generally there's no reason to do so.  I can't
 say I've ever had any reason to want to do that in any of the Debian
 packages I maintain.


Introspection isn't a particularly exotic function. -- IV


--
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/k2r311679a81004291441jf04dab98hdad9646f5e120...@mail.gmail.com



Re: Specifying %{variable} in control file for use in post inst?

2010-04-29 Thread Russ Allbery
Ignacio Valdes ival...@hal-pc.org writes:
 On Thu, Apr 29, 2010 at 3:55 PM, Russ Allbery r...@debian.org wrote:
 Ignacio Valdes ival...@hal-pc.org writes:

 So what is the usual method of accessing control file values such as
 Package: in postinst?

 Generally, you don't, since generally there's no reason to do so.  I
 can't say I've ever had any reason to want to do that in any of the
 Debian packages I maintain.

 Introspection isn't a particularly exotic function.

This discussion is missing a motivating application.  The glimmers that
I've gotten from your original discussion seemed to me like a basically
incorrect design, leading to needing features that wouldn't be required by
a better design.  But I can't tell for sure since I'm not sure what you're
really trying to do.

As a general rule of thumb, if you're writing complex postinst code,
you're doing something wrong.  There are exceptions, but not a lot of
them, and mostly for very complex packages.

-- 
Russ Allbery (r...@debian.org)   http://www.eyrie.org/~eagle/


--
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/877hnpq5or@windlord.stanford.edu



Re: Specifying %{variable} in control file for use in post inst?

2010-04-29 Thread Ignacio Valdes
On Thu, Apr 29, 2010 at 5:11 PM, Russ Allbery r...@debian.org wrote:
 Ignacio Valdes ival...@hal-pc.org writes:
 On Thu, Apr 29, 2010 at 3:55 PM, Russ Allbery r...@debian.org wrote:
 Ignacio Valdes ival...@hal-pc.org writes:

 So what is the usual method of accessing control file values such as
 Package: in postinst?

 Generally, you don't, since generally there's no reason to do so.  I
 can't say I've ever had any reason to want to do that in any of the
 Debian packages I maintain.

 Introspection isn't a particularly exotic function.

 This discussion is missing a motivating application.  The glimmers that
 I've gotten from your original discussion seemed to me like a basically
 incorrect design, leading to needing features that wouldn't be required by
 a better design.  But I can't tell for sure since I'm not sure what you're
 really trying to do.

 As a general rule of thumb, if you're writing complex postinst code,
 you're doing something wrong.  There are exceptions, but not a lot of
 them, and mostly for very complex packages.


It is a very complex, large package.

Does anyone know the mechanics of doing introspection in postinst for
the control file defined variables?

-- IV


--
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/m2v311679a81004291618y719cfd0bxafca92e4e3d46...@mail.gmail.com



Re: Specifying %{variable} in control file for use in post inst?

2010-04-29 Thread Thomas Goirand
Ignacio Valdes wrote:
 It is a very complex, large package.
 Does anyone know the mechanics of doing introspection in postinst for
 the control file defined variables?
   
Exactly why the postinst generation method that has been given as a
(pretty good) solution would not work?

Thomas


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4bda371c.4030...@goirand.fr



Re: Specifying %{variable} in control file for use in post inst?

2010-04-29 Thread Ignacio Valdes
On Thu, Apr 29, 2010 at 9:03 PM, Thomas Goirand tho...@goirand.fr wrote:
 Ignacio Valdes wrote:
 It is a very complex, large package.
 Does anyone know the mechanics of doing introspection in postinst for
 the control file defined variables?

 Exactly why the postinst generation method that has been given as a
 (pretty good) solution would not work?

Required to produce versions for both rpm and deb.  No introspection
means not easy to convert this from rpm to deb which is where this
started.  This would make it much easier to produce both deb and rpm
versions if it has the ability to introspect those variables.

-- IV


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/o2v311679a81004291919x78c89c6cn4594710895097...@mail.gmail.com



Re: Specifying %{variable} in control file for use in post inst?

2010-04-29 Thread Ignacio Valdes
So there is no cross-compatibility between debian control file and rpm
spec file for introspecting their respective package variables? -- IV


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/s2q311679a81004292204pe6a3b8dbt54660a683a2d4...@mail.gmail.com



Re: Specifying %{variable} in control file for use in post inst?

2010-04-29 Thread Russ Allbery
Ignacio Valdes ival...@hal-pc.org writes:

 So there is no cross-compatibility between debian control file and rpm
 spec file for introspecting their respective package variables?

There is no cross-compatibility between Debian package building and RPMs
at all.  They are not even remotely similar systems.  But yes, this in
particular does not work at similarly in Debian to how it works with RPM
spec files.

-- 
Russ Allbery (r...@debian.org)   http://www.eyrie.org/~eagle/


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/87iq79sdmn@windlord.stanford.edu



Re: Specifying %{variable} in control file for use in post inst?

2010-04-25 Thread Goswin von Brederlow
Ignacio Valdes ival...@hal-pc.org writes:

 Hi, I want to define a variable such as package_initials in control
 file and be able to access %{package_initials} in postinst file. Do I
 define it in control file as:

 XC-package_initials: the_initials

 or some other way?

 -- IV

mv debian/postinst debian/postinst.in

and in rules do

sed 's/%{package_initials}/initials/g'  debian/postinst.in  
debian/pkg.postinst

MfG
Goswin


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/87fx2jrhyo@frosties.localdomain



Re: Specifying %{variable} in control file for use in post inst?

2010-04-24 Thread Paul Wise
Why do you want to do this?

-- 
bye,
pabs

http://wiki.debian.org/PaulWise


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/r2ke13a36b31004242037j5fcea87r1cb00d808fe28...@mail.gmail.com



Re: Specifying %{variable} in control file for use in post inst?

2010-04-24 Thread Ignacio Valdes
Have to package two .deb flavors as well as two .rpm versions.  Can do
this with rpm using .rpmmacros but looking for the equivalent in .deb.
Is this not possible? The manuals seem to indicate that it is but not
exactly how. -- IV

On Sat, Apr 24, 2010 at 10:37 PM, Paul Wise p...@debian.org wrote:
 Why do you want to do this?



-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/v2t311679a81004242128i8b8ecd6az6a3d7ebb8e61e...@mail.gmail.com