LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 10-03-2014, 04:40 AM   #1
edbarx
Member
 
Registered: Sep 2010
Distribution: Used Debian since Sarge. (~2005)
Posts: 373

Rep: Reputation: 21
.deb package creation from a minimal set of files.


Is it possible to create a .deb package from these files alone?

The files are saved in a dedicated directory:
1) control
2) changelog
3) copyright
4) directory-tree-holding-all-the-package's-binary-files-and-symlinks


The source code consists of only one .cpp file which I edited from the systemd package.

Last edited by edbarx; 10-03-2014 at 05:31 AM.
 
Old 10-03-2014, 05:53 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
add 1: must be DEBIAN/control
add 2-3: ) changelog and copyright :
E.g. /usr/share/<app.name>/{ changelog copyright }

$ cd <dedicated directory>/
$ mkdir <app.name>
$ mv DEBIAN/ <app.name>/
$ mv <directory-tree..>/ <app.name>/

Build example :
$ dpkg-deb -b dummy dummy-1.1-1ubuntu14_amd64.deb
.. where `dummy´ is "<app.name>/", and dummy-1.1-1ubuntu14_amd64.deb
.. is your choice of version and <arch> ( must be e.g. i386 or amd64 ).

"control", from the example
Code:
Package: dummy
Version: 1.1-1
Section: base
Priority: optional
Architecture: amd64
Depends:
Installed-Size: 2400
Maintainer: Jerry Donut <jerry@donut.com>
Description: No description

Last edited by knudfl; 10-03-2014 at 05:59 AM.
 
Old 10-03-2014, 06:04 AM   #3
edbarx
Member
 
Registered: Sep 2010
Distribution: Used Debian since Sarge. (~2005)
Posts: 373

Original Poster
Rep: Reputation: 21
My intention is not to create an empty dummy package but to replace system libraries using dpkg. Maybe, a more concrete question is, how to create a source tree from scratch? However, I don't need to recompile my source file as that is already done.

It seems like package creation tools assume one starts from a standard source tree instead of starting from readily compiled executables. If this is the case, I will have no other option apart from implementing my own tools.
 
Old 10-03-2014, 06:24 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
The example in #2 is a real application.
See the example "control" → Installed-Size: 2400

"dummy" is a random name. Your choice of name was unknown.

Please show your `directory-tree/´,
i.e. not quite clear what it is you want.
But : You can put anything in a directory-tree.

. https://www.debian.org/doc/manuals/m.../build.en.html

* There is no such thing as a source-package.deb :
Sources come as app-name_version.tar.** + app-name_version-<>.debian.tar.**,
or : app-name_version.tar.** + app-name_version-<>.diff.gz

-
 
Old 10-03-2014, 12:21 PM   #5
replica9000
Senior Member
 
Registered: Jul 2006
Distribution: Debian Unstable
Posts: 1,130
Blog Entries: 2

Rep: Reputation: 260Reputation: 260Reputation: 260
Here is an example using atunes 2.0.0

Set up your directory structure like this. atunes-2.0.0 is pre-compiled. "all" is the architecture.

Code:
.
└── atunes-2.0.0
    └── all
        ├── DEBIAN
        │   ├── control                                                                                                                                       
        │   └── md5sums                                                                                                                                       
        └── usr
            ├── bin
            │   └── atunes
            └── share
                ├── applications
                │   └── atunes.desktop                                                                                                                        
                ├── atunes
                │   ├── aTunes.jar                                                                                                                            
                │   ├── aTunes.sh
                │   ├── changelog.txt                                                                                                                         
                │   ├── ico
                │   ├── lib
                │   │   ├── activation-1.1.jar                                                                                                                
                │   │   ├── bcel-5.2.jar                                                                                                                      
                │   │   ├── classworlds-1.1-alpha-2.jar                                                                                                       
                │   │   ├── commons-collections-3.1.jar                                                                                                       
                │   │   ├── commons-io-1.5-custom.jar                                                                                                         
                │   │   ├── commons-lang-2.4.jar                                                                                                              
                │   │   ├── ehcache-1.6.2.jar                                                                                                                 
                │   │   ├── filters-2.0.235.jar                                                                                                               
                │   │   ├── gstreamer-java-1.3.jar                                                                                                            
                │   │   ├── jakarta-regexp-1.4.jar                                                                                                            
                │   │   ├── jaudiotagger-2.0.2-SNAPSHOT.jar                                                                                                   
                │   │   ├── jcommon-1.0.15.jar                                                                                                                
                │   │   ├── jericho-html-3.1.jar                                                                                                              
                │   │   ├── jfreechart-1.0.12.jar                                                                                                             
                │   │   ├── jintellitype-1.3.3.jar                                                                                                            
                │   │   ├── jna-3.2.4.jar                                                                                                                     
                │   │   ├── junit-4.8.1.jar                                                                                                                   
                │   │   ├── jxgrabkey-1.0.jar                                                                                                                 
                │   │   ├── lastfm-bindings-160-SVN.jar                                                                                                       
                │   │   ├── libxine-custom.jar                                                                                                                
                │   │   ├── log4j-1.2.15.jar                                                                                                                  
                │   │   ├── lucene-core-3.0.0.jar                                                                                                             
                │   │   ├── mail-1.4.jar                                                                                                                      
                │   │   ├── maven-artifact-2.0.7.jar                                                                                                          
                │   │   ├── maven-model-2.0.7.jar                                                                                                             
                │   │   ├── maven-shared-jar-1.0.jar                                                                                                          
                │   │   ├── plexus-container-default-1.0-alpha-8.jar                                                                                          
                │   │   ├── plexus-digest-1.0.jar                                                                                                             
                │   │   ├── plexus-utils-1.4.1.jar                                                                                                            
                │   │   ├── plugin-system-1.7.jar                                                                                                             
                │   │   ├── substance-6.0.jar                                                                                                                 
                │   │   ├── substance-swingx-6.0.jar
                │   │   ├── swing-worker-1.1.jar
                │   │   ├── swingx-1.6.jar
                │   │   ├── trident-1.2.jar
                │   │   ├── xpp3_min-1.1.4c.jar
                │   │   └── xstream-1.3.1.jar
                │   ├── libJXGrabKey.so
                │   └── license.txt
                └── pixmaps
                    └── atunes125.png
Under the atunes-2.0.0 directory, build the package with this command:
Code:
dpkg -b all atunes_2.0.0-1_all.deb
 
Old 10-03-2014, 12:48 PM   #6
replica9000
Senior Member
 
Registered: Jul 2006
Distribution: Debian Unstable
Posts: 1,130
Blog Entries: 2

Rep: Reputation: 260Reputation: 260Reputation: 260
Quote:
Originally Posted by edbarx View Post
My intention is not to create an empty dummy package but to replace system libraries using dpkg. Maybe, a more concrete question is, how to create a source tree from scratch? However, I don't need to recompile my source file as that is already done.

It seems like package creation tools assume one starts from a standard source tree instead of starting from readily compiled executables. If this is the case, I will have no other option apart from implementing my own tools.
Are you replacing packages, or just individual files that exists in other packages? If it's individual files, you will need to use preinst and postrm scripts to use dpkg-divert, as the same file normally can't exist in two different installed packages. This also means you can update the other packages, and it won't overwrite your custom files installed by your package.
 
Old 10-04-2014, 02:41 AM   #7
edbarx
Member
 
Registered: Sep 2010
Distribution: Used Debian since Sarge. (~2005)
Posts: 373

Original Poster
Rep: Reputation: 21
I assume files installed by packages usually do not allow deletion by a normal user by having the root:root ownership flags. How can I tell dpkg -b to give me the correct file ownerships?
 
Old 10-04-2014, 03:04 AM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
← #7 .

. http://tldp.org/HOWTO/html_single/De...uilding-HOWTO/ : 5.3 fakeroot
. http://www.sj-vs.net/creating-a-simp...ory-structure/
. https://www.debian.org/doc/manuals/maint-guide/


Other tips ..
. http://raphaelhertzog.com/2010/12/17...e-with-dpkg-b/
. https://www.google.com/webhp?hl=all&...directory+tree
. https://www.debian.org/doc/manuals/maint-guide/
. https://wiki.debian.org/IntroDebianPackaging



-

Last edited by knudfl; 10-04-2014 at 03:17 AM.
 
Old 10-04-2014, 04:27 AM   #9
edbarx
Member
 
Registered: Sep 2010
Distribution: Used Debian since Sarge. (~2005)
Posts: 373

Original Poster
Rep: Reputation: 21
The only way it worked was to run chown -R root:root for the full package directory. Then I built the package with dpkg -b as the other methods are overly complicated for the task at hand.

Last edited by edbarx; 10-04-2014 at 04:35 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Tool for monitoring installation of files (for package creation)? browny_amiga Linux - General 2 08-10-2009 08:43 AM
.deb vs .rpm package creation uselpa Linux - Distributions 2 09-04-2007 12:45 AM
Possible to build deb package from source files? davidas Debian 9 12-09-2006 06:27 PM
Command for where the individual files are for a deb package farpoint Debian 2 06-09-2006 06:29 AM
Howto on making .deb package files preben Debian 1 08-21-2003 07:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 01:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration