diff --git a/.gitignore b/.gitignore index 8000dd9..099a8d6 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,8 @@ .vagrant +Test/debian/files +Test/debian/debhelper-build-stamp +Test/debian/ldd2debs.debhelper.log +Test/debian/ldd2debs.substvars +Test/debian/.debhelper/ +Test/debian/ldd2debs/ +Test/debian/files diff --git a/README.md b/README.md index 543f979..3e2d917 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,8 @@ To add badges for GitHub Actions, you can use the following markdown: -```markdown ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/VitexSoftware/BuildImages/docker-image.yml?branch=main) -``` + Source of Docker images used for Debian/Ubuntu package building diff --git a/Test/README.md b/Test/README.md index 6c2ccb6..a534407 100644 --- a/Test/README.md +++ b/Test/README.md @@ -3,4 +3,21 @@ ldd2debs Find packaging dependencies for binaries +This script provides information about package dependencies for a given binary. + +Usage: + ./ldd2debs [OPTION] BINARY + +Options: + --help, -h Display help information and usage examples. + --version, -v Display the version of the script. + +Example: + ./ldd2debs /bin/bash + +The script uses `ldd` to list the shared library dependencies of the given binary, +then uses `apt-file search` to find the packages that provide those libraries, +and finally outputs a sorted list of unique package names. + + (also Test/Example for https://github.com/VitexSoftware/BuildImages/) diff --git a/Test/debian/README.Debian b/Test/debian/README.Debian index fd85745..1d99189 100644 --- a/Test/debian/README.Debian +++ b/Test/debian/README.Debian @@ -1,8 +1,5 @@ -vitexsoftware-build-images for Debian +ldd2debs for Debian -Please edit this to provide information specific to -this vitexsoftware-build-images Debian package. - - (Automatically generated by debmake Version 4.3.2) +Just Install & use -- Vítězslav Dvořák Mon, 22 Nov 2021 22:07:33 +0100 diff --git a/Test/debian/changelog b/Test/debian/changelog index 25f8246..8da93d8 100644 --- a/Test/debian/changelog +++ b/Test/debian/changelog @@ -1,6 +1,7 @@ ldd2debs (0.1) UNRELEASED; urgency=low - * Initial release. Closes: #nnnn - + * Just Example + * Specify versions for essential package dependencies + -- Vítězslav Dvořák Mon, 22 Nov 2021 22:07:33 +0100 diff --git a/Test/debian/compat b/Test/debian/compat deleted file mode 100644 index ec63514..0000000 --- a/Test/debian/compat +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/Test/debian/control b/Test/debian/control index da8d930..70d5029 100644 --- a/Test/debian/control +++ b/Test/debian/control @@ -1,19 +1,17 @@ Source: ldd2debs -Section: development +Section: devel Priority: optional Maintainer: Vítězslav Dvořák -Build-Depends: debhelper, dpkg-dev, sed +Build-Depends: debhelper, dpkg-dev (>= 1.20.9), sed (>= 4.7), debhelper-compat (= 12) Standards-Version: 4.5.0 Homepage: https://github.com/VitexSoftware/BuildImages Vcs-Git: https://github.com/VitexSoftware/BuildImages.git Vcs-Browser: https://github.com/VitexSoftware/BuildImages Package: ldd2debs -Architecture: any +Architecture: all Multi-Arch: foreign -Depends: ${misc:Depends}, - ${shlibs:Depends}, - apt-file, sed, awk, coreutils, libc-bin +Depends: ${shlibs:Depends}, ${misc:Depends}, coreutils (>= 8.30), libc-bin (>= 2.28), sed (>= 4.7) Description: pull current VitexSoftware's build images This Debian binary package was used to test of deb packaging docker images for several distros diff --git a/Test/debian/copyright b/Test/debian/copyright index 170bfc6..68954e5 100644 --- a/Test/debian/copyright +++ b/Test/debian/copyright @@ -1,14 +1,25 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: vitexsoftware-build-images -Upstream-Contact: -Source: -# -# Please double check copyright with the licensecheck(1) command. +Upstream-Name: ldd2debs +Upstream-Contact: Vítězslav Dvořák +Source: https://github.com/VitexSoftware/BuildImages/tree/main/Test -Files: Jenkinsfile -Copyright: __NO_COPYRIGHT_NOR_LICENSE__ -License: __NO_COPYRIGHT_NOR_LICENSE__ - -#---------------------------------------------------------------------------- -# Files marked as NO_LICENSE_TEXT_FOUND may be covered by the following -# license/copyright files. +Files: * +Copyright: 2023 Vítězslav Dvořák +License: MIT + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. diff --git a/Test/debian/files b/Test/debian/files index c2d1108..02bfe0f 100644 --- a/Test/debian/files +++ b/Test/debian/files @@ -1,2 +1,2 @@ -ldd2debs_0.1_amd64.buildinfo development optional -ldd2debs_0.1_amd64.deb development optional +ldd2debs_0.1_all.deb devel optional +ldd2debs_0.1_amd64.buildinfo devel optional diff --git a/Test/debian/ldd2debs.1 b/Test/debian/ldd2debs.1 index 88d17d9..6967fea 100644 --- a/Test/debian/ldd2debs.1 +++ b/Test/debian/ldd2debs.1 @@ -1,62 +1,39 @@ -.\" Hey, EMACS: -*- nroff -*- -.\" (C) Copyright 2021 Vítězslav Dvořák , -.\" -.\" See http://www.debian.org/doc/manuals/maint-guide/dother.en.html#manpage1 -.\" -.\" 1. Use this as the template for the manpage for after -.\" renaming this file to .1 (if it is for section 1). -.\" -.\" 2. List the path to this file in debian/.manpages to -.\" install this manpage to the target binary package. -.\" -.\" First parameter, LDD2DEBS, should be all caps -.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection -.\" other parameters are allowed: see man(7), man(1) -.TH LDD2DEBS SECTION "22 Nov 2021" -.\" Please adjust this date whenever revising the manpage. -.\" -.\" Some roff macros, for reference: -.\" .nh disable hyphenation -.\" .hy enable hyphenation -.\" .ad l left justify -.\" .ad b justify to both left and right margins -.\" .nf disable filling -.\" .fi enable filling -.\" .br insert line break -.\" .sp insert n+1 empty lines -.\" for manpage-specific macros, see man(7) +.TH LDD2DEBS 1 "October 2023" "v0.1" "ldd2debs manual" + .SH NAME -ldd2debs \- so libs to deb files +ldd2debs \- show packages with dependencies for a given binary + .SH SYNOPSIS .B ldd2debs -.RI [ options ] " files" ... -.br -.B bar -.RI [ options ] " files" ... +[\fIoptions\fR] \fIbinary\fR + .SH DESCRIPTION -This manual page documents briefly the .B ldd2debs -command. -.PP -.\" TeX users may be more comfortable with the \fB\fP and -.\" \fI\fP escape sequences to invode bold face and italics, -.\" respectively. -\fBldd2debs\fP is a program that search for packages which contains .so files linked to given binary +is a script that shows the packages with dependencies for a given binary. + .SH OPTIONS -These programs follow the usual GNU command line syntax, with long -options starting with two dashes (`-'). -A summary of options is included below. -For a complete description, see the Info files. .TP -.B \-h, \-\-help -Show summary of options. +.B \-\-help, \-h +Show help message and usage example. .TP -.B \-v, \-\-version -Show version of program. +.B \-\-version, \-v +Show the version of the script. + +.SH EXAMPLES +To show the packages with dependencies for /bin/bash: +.PP +.B ldd2debs /bin/bash + +.SH AUTHOR +Vítězslav Dvořák + +.SH LICENSE +This script is licensed under the MIT License. + .SH SEE ALSO -.BR bar (1), -.BR baz (1). -.br -The programs are documented fully by -.IR "The Rise and Fall of a Fooish Bar" , -available via the Info system. +.BR ldd (1), +.BR apt-file (1), +.BR awk (1), +.BR sed (1), +.BR sort (1), +.BR uniq (1) \ No newline at end of file diff --git a/Test/ldd2debs b/Test/ldd2debs index 35205e8..bf1dbee 100755 --- a/Test/ldd2debs +++ b/Test/ldd2debs @@ -1,6 +1,5 @@ #!/bin/sh - case $1 in "--help" | "-h") echo "show packages with dependencies for given binary. Example:" @@ -9,7 +8,7 @@ ;; "--version" | "-v" ) echo "ldd2debs v0.1" - break + exit 0 ;; *) ldd $1 | awk '/=>/{print $(NF-1)}' | while read n; do apt-file search $n; done | awk '{print $1}' | sed 's/://' | sort | uniq