postgresqldebian-packagingapache-age

How to change the default directory structure of dh_make so that dpkg-buildpackage does not throw any errors


I am trying to create a debian package for a postgreSQL extension Apache-age release 1.1.1 and created the directory structure using dh_make command. The directory structure is as follows:

age-1.1.1 (project root)
├── debian
│   ├── changelog
│   ├── compat
│   ├── control
│   ├── docs
│   ├── examples
│   ├── links
│   ├── manpages
│   ├── menu
│   ├── postinst
│   ├── postrm
│   ├── preinst
│   ├── prerm
│   ├── rules
│   ├── source
│   └── watch
├── src
└── Makefile

The dpkg-buildpackage -b when run from project-root folder it looks for debian folder, then reads the rule file, then reads the Makefile located in the project root to build the package.

I want to change the directory structure to the following:

.project root
    ├── packaging
    │   ├── debian
    │   │   ├── control
    │   │   ├── control.in
    │   │   ├── changelog
    │   │   ├── copyright
    │   │   ├── pgversions
    │   │   ├── rules
    │   │   └── ...
    │   └──
    ├── src
    ├── LICENSE
    ├── README.md
    ├── Makefile
    └── ...

I want to change the directory structure so that the dpkg-buildpackage -b command can be run from the packaging folder and it should build the package.


Solution

  • I'm not sure if this is the best way to do this but it's working for me:

    Here are the steps:

    Note: In step 1 we are running dh_make_pgxs in the project root first, this is to make sure that the project name in the control files and the version in the changelog file are correct. In this case the name/source in control, control.in & changelog files should be apache-age and the version number in changelog file should be 1.1.1-1.
    Alternatively, you can run the command from the packaging directory and manually change the name and version in the control and changelog files.