Sunday, March 4, 2018

packaging - Can I make deb files for documents and other non-binary content?



I would like to create .deb files with no binary content (*.odt files, for example).




The idea is to create a file that contains didactic files to learn certain discipline and an automatically package downloader, to get needed packages for discipline learning. For example, C# *.pdf tutorials followed for the download of MonoDevelop (C# IDE), for C# programming classes.



If the package do not publish in public space, but that is only for your own local use, you can make the deb package by the below steps.



In this example, Package name: doc-sample, Package version: 0.1, the final installing directory is /usr/share/doc/doc-sample/sample-docs.



Step1: Prepare directories to make the deb package.



The name of directory need to include version number.




mkdir -p doc-sample-0.1/sample-docs
cd doc-sample-0.1


Then, add the documents which you want to install , in doc-sample-0.1/sample-docs directory.



Step2: Prepare debian directory in default form.



Run the below command in doc-sample-0.1 directory.




dh_make -n -s -e (mail_address)


(mail_address): ex. user@example.com



If it is the form of a mail address, it does not matter even if it is not the mail address actually used anything.



Step3: Remove unneccesary texts.



rm debian/*.ex debian/*.EX debian/README.Debian debian/README.source



Step4: Make the setting file named "(package_name).install" to install documents.



nano debian/doc-sample.install


Describe using the form: (documents_directory_name) space (install_directory)



sample-docs  usr/share/doc/doc-sample



When you install the final deb package, the sample-docs folder will install to /usr/share/doc/doc-sample directory in this case. (Caution: each files are compressed in .gz form)



Step5: Building deb package.



If you will build the deb package only for your own local use, you can skip promptings for the GPG signatures on the .dsc file and the .changes file.



Run the below command in doc-sample-0.1 directory.




dpkg-buildpackage -us -uc


So, you can get the deb package named doc-sample_0.1_i386.deb in upper directory.



If you want to publish in a public space (ex. PPA), you need to consider the license of a document, and sign the .dsc file and the .changes file by using GPG key.



For details, please refer to the documents for developers.


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...