{"id":28192235,"url":"https://github.com/penguinpowernz/go-ian","last_synced_at":"2025-05-16T11:12:49.644Z","repository":{"id":57555633,"uuid":"116782285","full_name":"penguinpowernz/go-ian","owner":"penguinpowernz","description":"Simple debian package building and management","archived":false,"fork":false,"pushed_at":"2021-09-24T03:02:53.000Z","size":72,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T16:50:19.925Z","etag":null,"topics":["apt","debian","debian-packages","dpkg","packagecloud"],"latest_commit_sha":null,"homepage":"https://penguinpowernz.github.io/go-ian","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/penguinpowernz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-09T07:35:49.000Z","updated_at":"2022-04-01T06:10:53.000Z","dependencies_parsed_at":"2022-09-14T11:00:54.767Z","dependency_job_id":null,"html_url":"https://github.com/penguinpowernz/go-ian","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/penguinpowernz%2Fgo-ian","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/penguinpowernz%2Fgo-ian/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/penguinpowernz%2Fgo-ian/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/penguinpowernz%2Fgo-ian/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/penguinpowernz","download_url":"https://codeload.github.com/penguinpowernz/go-ian/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254518327,"owners_count":22084376,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apt","debian","debian-packages","dpkg","packagecloud"],"created_at":"2025-05-16T11:12:48.561Z","updated_at":"2025-05-16T11:12:49.638Z","avatar_url":"https://github.com/penguinpowernz.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-ian\n\nSimple debian package building and management named in memory of the late Ian Murdock, founder of the Deb**ian** project.\n\nThe purpose of this tool is to decrease the overhead in maintaining a debian package stored \nin a git repository. It tries to mimic the CLI of other popular tools such as git and bundler.\nIt is intended to be helpful when integrating other build tools/systems and with CI/CD.\n\nIt has been ported to golang from the [ruby project of the same name](https://github.com/penguinpowernz/ian).\n\nYou can download binaries and Debian packages from the [releases](https://github.com/penguinpowernz/go-ian/releases) page.\n\n## Requirements\n\nI shell out a bit to save time, will eventually make things more native.  For now, need the following tools:\n\n* dpkg-deb\n* fakeroot\n* rsync\n\nThis should do it.\n\n    sudo apt-get install fakeroot dpkg-dev rsync coreutils findutils\n\n## Installation\n\nSimple to build / install, provided you have go setup:\n\n    go get github.com/penguinpowernz/go-ian\n    go install github.com/penguinpowernz/go-ian/cmd/ian\n\nOr you can download a pre-built binary or Debian package from [the releases page](https://github.com/penguinpowernz/go-ian/releases).\n\n## Usage\n\nThis tool is used for working with what Debian called \"Binary packages\" - that is ones that have the `DEBIAN`\nfolder in capitals to slap Debian packages together quickly. It uses dpkg-deb -b in the background which most\nDebian package maintainers frown at but it is suitable enough for rolling your own packages quickly, and it\nscratches an itch.\n\n### Creation/Initializing\n\n    ian new my-package\n\nAnalogous to `bundle new gemname` or `rails new appname` this will create a folder called `my-package` in the\ncurrent folder and initialize it with the appropriate debian files.\n\n    ian init\n\nAnalagous to `git init` this will do the same as `new` but do it in the current folder.\n\nNow you will see you have a `DEBIAN` folder with a `control` and `postinst` file.\n\n### Info\n\n    ian info\n\nThis will simply dump the control file contents out.\n \n### Set fields in the control file\n\nThe architecture and the version can be set quickly in this manner.  Other fields are not (yet) supported.\n\n    ian set -a amd64\n    ian set -v 1.2.3-test\n\nYou can also use increments on semantic versions like so:\n\n    ian set -v +M    # increment the Major number\n    ian set -v +m    # increment the minor number\n    ian set -v +p    # increment patch level\n\n### Packaging\n\n    ian pkg [-b]\n\nThe one you came here for.  Packages the repo in a debian package, excluding junk files like `.git` and `.gitignore`, \nmoves root files (like `README.md`) to a `/usr/share/doc` folder so you don't dirty your root partition on install.  \nThe package will be output to a `pkg` directory in the root of the repo.  It will also generate the md5sums file\nand calculate the package size proir to packaging.  By adding a `-b` flag it will run the build script before\npackaging.\n\n### Build\n\n    ian build\n\nThis will run the build script found in `DEBIAN/build` parsing it the following arguments:\n\n* root directory of the package git repository\n* architecture from the control file\n* version from the control file\n\nIt can do whatever things you need it to do to prepare for the packaging such as building binaries, etc.\n\n### Push\n\n    ian push [target]\n\nSetup scripts to run in a file called `.ianpush` in the repo root and running `ian push` will run all the lines in\nthe file as commands with the current package.  The package filename will be appended to each command unless `$PKG`\nis found on the line, in which case that will be replaced with the package filename.  Also the target name can be\ngiven as an argument to push to specfic targets (supports globbing).\n\n    package_cloud push user/app-testing/debian/wheezy\n    stable: package_cloud push user/app-stable/debian/wheezy\n    devbox: scp $PKG root@192.168.1.200:~\n    s3: aws s3 cp $PKG s3://mybucket/dpkg/\n\nNote that targets requiring input will fail as there is no terminal attached to the command.  For SCP, it is recommended\nto use the SSH config files to your advantage.\n\n### Other\n\nSome other commands:\n\n    ian install     # installs the current package\n    ian excludes    # shows the excluded files\n    ian size        # calculates the package size (in kB)\n    ian -v          # prints the ian version\n    ian version     # prints the package version\n    ian versions    # prints all known versions\n    ian deps        # prints the dependencies line by line\n    bpi             # run build, pkg, install\n    pi              # run pkg, install\n    pp [target]     # run pkg, push\n    bp              # run build, pkg\n    bpp [target]    # run build, pkg push\n\nYou can also use the envvar `IAN_DIR` in the same way that you would use `GIT_DIR` - that is, to do stuff\nwith ian but from a different folder location.\n\nUse `DEBUG=1 ian pkg` to show debug logs for ian commands.\n\n## Library Usage\n\n[![GoDoc](https://godoc.org/github.com/penguinpowernz/go-ian/debian/control?status.svg)](https://godoc.org/github.com/penguinpowernz/go-ian/debian/control)\n\nThe Debian package `Control` struct could come in handy for others.  As a quick overview here's what it can do:\n\n* `Parse([]byte) (Control, error)` - parse the bytes from the control file\n* `Read(string) (Control, error)` - read the given file and parse it's contents\n* `Default() (Control)` - a default package control file\n* `ctrl.Filename() string` - the almost Debian standard filename (missing distro name)\n* `ctrl.String() string` - render the control file as a string\n* `ctrl.WriteFile(string) error` - write the string into the given filename\n\nPlus the exported fields on the `Control` struct that mirror the dpkg field names.\n\nFor more information please check the godocs.\n\n## Dogfooding\n\nThe debian package source for Ian is actually managed by Ian in the folder `dpkg`. So you can build the debian\npackage for ian, using ian.  Give it a try!\n\n    go get github.com/penguinpowernz/go-ian\n    go install github.com/penguinpowernz/go-ian/cmd/ian\n    cd $GOPATH/src/github.com/penguinpowernz/go-ian/dpkg\n    ian build\n    ian pkg\n    sudo $GOBIN/ian install # or sudo dpkg -i pkg/ian_v1.0.0_amd64.deb\n\n## TODO\n\n* [ ] more tests\n* [x] add help page\n* [ ] add subcommands help\n* [ ] releasing\n* [x] pushing\n* [x] test pushing\n* [x] ignore file\n* [ ] allow specifying where to output the package to after building\n* [ ] deps management\n* [x] running of a build script\n* [x] install after packaging\n* [ ] package a specific version\n* [ ] optional semver enforcement\n* [ ] utilize rules file\n* [ ] support copyright file\n* [ ] support changelog\n* [x] don't shell out for md5sums\n* [ ] don't shell out for rsync\n* [x] don't shell out for find\n* [ ] don't shell out for dpkg-deb\n* [x] pull maintainer from git config\n\n## Contributor Code of Conduct\n\nThis project adheres to No Code of Conduct.  We are all adults.  We accept anyone's contributions.  Nothing else matters.\n\nFor more information please visit the [No Code of Conduct](https://github.com/domgetter/NCoC) homepage.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/penguinpowernz/ian.\n\n## In Memory Of\n\nIn memory of Ian Ashley Murdock (1973 - 2015) founder of the Debian project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpenguinpowernz%2Fgo-ian","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpenguinpowernz%2Fgo-ian","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpenguinpowernz%2Fgo-ian/lists"}