LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   .deb package creation from a minimal set of files. (https://www.linuxquestions.org/questions/debian-26/deb-package-creation-from-a-minimal-set-of-files-4175520935/)

edbarx 10-03-2014 04:40 AM

.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.

knudfl 10-03-2014 05:53 AM

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


edbarx 10-03-2014 06:04 AM

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.

knudfl 10-03-2014 06:24 AM

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

-

replica9000 10-03-2014 12:21 PM

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

replica9000 10-03-2014 12:48 PM

Quote:

Originally Posted by edbarx (Post 5248410)
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.

edbarx 10-04-2014 02:41 AM

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?

knudfl 10-04-2014 03:04 AM

← #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



-

edbarx 10-04-2014 04:27 AM

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.


All times are GMT -5. The time now is 11:43 PM.