npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

dbuild

v1.0.0

Published

Docker based build system for building linux installation media

Downloads

3

Readme

dbuild

dbuild is a docker based build system to facilitate linux package generation.

dbuild will:

  • Create a docker container for each platform specified.
  • Install specified dependencies using the platforms package manager.
  • Execute the user specified compilation and package generation script.
  • Populate the builds directory with an installation package for each platform specified.

dbuild will not:

  • Solve dependency hell.
  • Test resulting packages (yet)

Prerequisites

  • Docker

Usage

dbuild should be installed globally with,

$ npm install dbuild -g

A typical dbuild directory structure is as follows,

project_root
    |
    |-- source_dir
    |      |- source files
    |-- log_dir *
    |      |- build log files
    |-- builds_dir *
    |      |- built packages
    |-- dbuild.json
    |-- dbuild.sh

(*) log and builds directories will be created automatically if they do not already exist.

dbuild may be invoked from the project root to build for all specified platforms with,

$ dbuild

or for a specific platform (which is specified in dbuild.json)

$ dbuild -p ubuntu:17.10

or for all versions of the same platform (which are specified in dbuild.json)

$ dbuild -p ubuntu

or for multiple independent platforms,

$ dbuild -p ubuntu:17.10 -p centos:7

dbuild.json

The dbuild.json specifies,

  • Package metadata
  • Which platforms to build packages for
  • The package dependencies (Note: name only, version is controlled by linux distribution)
  • The relative path to source, log, and builds directories

Use the sample dbuild.json to get started,

{
    "package":{"name":"myCode", "version":"0.0.1"},
    "platforms":{
        "apt":["ubuntu:17.10", "ubuntu:17.04", "ubuntu:16.04"],
        "yum":["centos:7","centos:6"]
    },
    "dependencies":[
        {"name":"python-dev","apt":"python-dev","yum":"python-devel"},
        {"name":"libz-dev","ubuntu":"libz-dev","centos":"zlib-devel"},
        {"name":"cmake"},
        {"name":"build-essential", "ubuntu":"build-essential", "centos":"make glibc-devel gcc gcc-c++ patch rpm-build"}
    ],
    "directories":{
        "src":"src",
        "builds":"builds",
        "log":"log"
    }
}

Platforms

Platforms are specified according to whether they are apt or yum based. Support for other platforms may be added in future (Create an issue if you require other platforms)

Platform names are given corresponding to those available on Docker Hub.

Dependencies

The dependencies array must give the name of a dependency at a minimum. If no other aliases are specified dbuild will attempt to install this dependency using this name. Package aliases may be specified either by package manager name, platform name, or platform name and version.

dbuild.sh

This script should compile the source code and create the output package. The following environment variables may be used,

| Environment Variable | Description | |----------------------|-----------------------------------| | SOURCE_DIR | Path to the source code directory | | BUILDS_DIR | Path to the builds directory | | LOG_DIR | Path to the log directory | | PACKAGE_TYPE | RPM or DEB depending on platform |

source_dir

This directory must be included and specified by the user.