How to build a MANIFEST file for a Perl module - perl

I create some modules without using Module::Starter :(.
I need to build a MANIFEST file to run my tests.
Should I do it by hand, or is there an automated way to build it ?

Run make manifest or ./Build manifest, depending on the build tool.
It will call mkmanifest for you.

You can create manifest using ExtUtils::Manifest package:
perl -MExtUtils::Manifest=mkmanifest -e 'mkmanifest()'
This oneliner will create manifest in current dir. It also will use MANIFEST.SKIP if you have one.

If you install Dist::Zilla, you can set up a simple dist.ini file and then run dzil build. That will create a MANIFEST and other necessary files for releasing a distribution.

Well, there is ExtUtils::Manifest:
mkmanifest
mkmanifest();
Writes all files in and below the current directory to your MANIFEST. It works similar to the result of the Unix command
find . > MANIFEST
All files that match any regular expression in a file MANIFEST.SKIP (if it exists) are ignored.
Any existing MANIFEST file will be saved as MANIFEST.bak.
For example:
$ perl -mExtUtils::Manifest=mkmanifest -e 'mkmanifest()'

Related

How to define rule file in debian packaging of a project which have a make file to build from source?

I'm new to stackoverflow so correct me if I made any mistake in providing the details.
So I'm trying to make a deb file for Apache-Age, and going by the documentation, if we try to install AGE from source then we can simply do it by :
make install
I have setup the basic directory structure by dh_make and have made the control file with proper dependencies, then comes the rule file.
So I went through 2 different extensions of postgreSQL :
postgresql-q3c
Postgis
And tried to replicate the same for apache-age, and tried to build by following commands
dpkg-buildpackage -rfakeroot -b
dpkg-buildpackage -nc -i
the build was giving some errors and warning but a deb file was generated.
The deb file installed properly but age-extension was not installed in PostgreSQL.
It's probably because the age was not building properly from source using make command as specified in the rule file.
Is there any good resource or how to make rule file ?
I tried following this answer, but got stuck here.
I found a PDF but didn't understand the build process.
This might be a naive way but it works for me:
Clone the repo and cd to it
Run the dh_make_pgxs command to make the debian build directory structure.
The you need to make changes to pgversion, control/control.in, changelog, copyright and rule files.
If you are just trying to use the make file to build the package then the rule file can be as simple as:
#!/usr/bin/make -f
%:
dh $#
Then simply run the build command as before.

How can I configure rpmbuild to use lib64/perl5 as an install path?

I am running CentOS7 (RHEL7) and I am trying to build a Perl module with rpmbuild. I have generated the SPEC file and it builds all the way until it installs, which fails.
error: File not found by glob: /home/user/rpm/BUILDROOT/perl-Data-Dumper-2.167_02-1.el7.centos.x86_64/usr/lib64/perl5/vendor_perl/auto/*
I see that in the .spec file, it is looking for %{perl_vendorarch}/auto/* so it's looking in the right place (same place that yum installs pre-built rpms for perl modules.)
HOWEVER, when doing the install phase, it seems rpmbuild is trying to use (via the MakeMaker generated Makefile) my PERL5LIB /home/user/perl5/lib/perl5. I can change the INSTALL_DIR via the spec to /usr, however, I can't figure out how to change the suffix to lib/perl5
Is there anyway to tell MakeMaker to use a different suffix?

How to Build an RPM from Source in One Line without Spec Files etc?

I've been reading about building RPMs, and the process is quite complex. Is there any program/software that works like this:
Download tar.gz file. Extract to directory
cd into directory
Run
RPM file is output into the directory
Does any such program exist? It seems as if it should. After all, when I run make, make install etc, I don't need to specify spec files, provide locations for where the software has to be installed. So why should I have to do all that for creating RPMs?
I've tried using checkinstall, but I keep getting errors like "Directory not found: /root/rpmbuild/BUILDROOT/hello-2.10-1.x86_64/usr"
So is there an easier way?
No. There is no easier way.
Sometimes upstream provide 'make rpm' target. Sometime checkinstall works. But often you have to create the spec file manually.
BTW that error from checkinstall reveals two things:
you are running that command as root. That is very very unwise.
you should create few build directories. Run command rpmdev-setuptree it will create them for you.

Is it possible to deconstruct and reconstruct a WIX executable?

I have a WIX executable install package which for the sake of simplicity lets just call setup.exe. Using a Powershell script I need to do the following with this package:
1. Deconstruct the setup.exe WIX package.
2. Unpack the setup.msi file contained within.
3. Modify a config file within the unpacked setup.msi.
4. Repack setup.msi with this new config.
5. Reconstruct the setup.exe WIX package.
Currently I can do steps 1 to 4 in the following way:
1. Run dark.exe -x OutputFolder1 setup.exe.
2. Run ms2xml.exe -c OutputFolder2 setup.msi
3. Update the config file.
4. Run xml2msi.exe -m setup.xml
Unfortunately at this point I can't recreate the WIX package using the modified setup.msi even though OutputFolder1 appears to contain all the information that WIX would need to recreate the package.
Therefore is there a way to recreate a WIX package that was deconstructed using dark? Alternatively is there another way to achieve this without using dark?
You need Light.exe to rebuild a bundle. It can't start from a decompiled bundle.

Build libraries in external folder of AOSP source code

I noticed that a simple
$ . build/envsetup.sh
$ lunch
$ aosp_hammerhead-eng
$ make -j16
Would not build also the external libraries in the ./external folder.
How am I supposed to build source code in such folder?
In particular, I am modifying source code in the libselinux in ./external/selinux/libselinux/src/
Thanks!
I found out that, by using the mm command, it is possible to build all of the modules in the current directory.
So, if you are in ./external/selinux/libselinux/ you can build all code inside such directory just by typing the command mm.
I also found that the same code I was modifying inside the ./external/selinux/libselinux/ is also located in ./external/libselinux/. However, this directory is linked to the make -j16 command.