Giter Site home page Giter Site logo

jozovilcek / gradle-debian-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gesellix/gradle-debian-plugin

0.0 2.0 0.0 2.52 MB

Gradle plugin to create Debian packages

Home Page: http://www.gesellix.net/

License: Apache License 2.0

Groovy 80.81% Shell 19.19%

gradle-debian-plugin's Introduction

Gradle plugin to create Debian packages

Build Status Coverage Status

About

You can package your files or publications (currently only MavenPublications are supported) in Debian compatible packages with the help of this Gradle plugin. Under the hood the very convenient jdeb library is used, and this plugin only represents some kind of bridge between your Gradle build and jdeb.

There already are other plugins with the same goal, but after trying two or three of the most promising implementations, I came to the conclusion that I didn't want too much setup like fpm or too much hazzle with quite detailed build configurations. Some plugins also tried to use the same build config to create .deb and .rpm packages.

Since I don't need RPM packages (at least for now) and because everyone should do something new (creating a Gradle plugin) from time to time, there it is: Yet another Gradle Debian package plugin!

You should know what you're doing!

The plugin won't check your .deb package configuration for any problems, so it's up to you to use such great tools like lintian. The Debian New Maintainers' Guide was a good manual for me to understand the Debian package concepts. You should at least read chapters 4. and 5. to get some basic knowledge about which files and folder structures are required.

Packaging badly tested scripts might damage your and other peoples' system.

Ok, let's have some fun!

Download

Download latest version

The plugin is available at Bintray for Maven compatible repositories or as manual download.

Building on your own

This should be as easy as doing something like follows, provided that you have git installed and you have found a nice parent directory on your machine:

git clone https://github.com/gesellix/gradle-debian-plugin.git
cd gradle-debian-plugin
./gradlew build install

Usage

Your Gradle build needs to be configured as shown below. Some properties in debian{ ... } are optional, but I still need to finish tests and other aspects before writing a complete documentation.

Looking at the tests in the source repository you can find similar examples and you'll see that I had the goal to package a Tomcat compatible webapp. Apart from that, it's really up to you what is being included in your .deb package, you just need to configure the right file paths and task dependencies.

buildscript {
  repositories {
    maven {
      url "http://dl.bintray.com/gesellix/gradle-plugins"
    }
    mavenCentral()
    mavenLocal()
  }
  dependencies {
    classpath "de.gesellix:gradle-debian-plugin:14"
  }
}

publishing {
  publications {
    webapp(MavenPublication) {
      from components.web  // .war
    }
  }
}

apply plugin: 'pkg-debian'

debian {
  packagename = "packagename"
  publications = ['webapp']
  controlDirectory = "/path/to/control"
  changelogFile = "/path/to/changelog"

  data {
    def baseDir = "/path/to/data"
    dir {
      name = baseDir
      exclusions = [
          "etc/init.d/packagename"]
      mapper {
        filename = { path -> "opt/" + path }
      }
    }
    file {
      name = "${baseDir}/etc/init.d/packagename"
      target = "etc/init.d/packagename"
      mapper {
        fileMode = "755"
      }
    }
    link {
      path = "/etc/packagename/"
      name = "var/lib/packagename/conf"
    }
  }
}

Versioning

I currently don't support Semantic Versioning or similar concepts, just because I don't expect too many breaking changes to come. My preference will be to not break any interface. So, I will just count the version numbers up, one after the other. Yep, stupid me... but who knows, I could probably make up my mind in the future.

License

Currently licensed under Apache License, Version 2.0. See the LICENSE file in the source repository root for details.

I would be glad if you try to create pull requests for missing features or when finding bugs!

gradle-debian-plugin's People

Contributors

gesellix avatar groestl avatar jozovilcek avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.