@ Override public Path build ( Path base ) throws IOException { this . dir = base . resolve ( name + "-" + version ) ; this . debian = dir . resolve ( "debian" ) ; control . setStandardsVersion ( STANDARDS_VERSION ) ; changeLog . set ( name , version , release , maintainer ) ; control . setSource ( name ) ; for ( FileBuilder fb : fileBuilders ) { fb . build ( ) ; } copyright . save ( debian ) ; control . save ( debian ) ; changeLog . save ( debian ) ; // compat Path compat = debian . resolve ( "compat" ) ; try ( BufferedWriter bf = Files . newBufferedWriter ( compat , UTF_8 ) ) { bf . append ( String . format ( "%d\n" , compatibility ) ) ; } for ( MaintainerScript ms : maintainerScripts ) { ms . save ( ) ; } // rules Path rules = debian . resolve ( "rules" ) ; FileUtil . copyResource ( "/rules" , rules , DEBBuilder . class ) ; PosixHelp . setPermission ( rules , "-rwxr-xr-x" ) ; // source/format Path source = debian . resolve ( "source" ) ; Files . createDirectories ( source ) ; Path format = source . resolve ( "format" ) ; try ( BufferedWriter bf = Files . newBufferedWriter ( format , UTF_8 ) ) { bf . append ( SOURCE_FORMAT ) ; } conffiles . save ( debian ) ; docs . save ( debian ) ; try { OSProcess . call ( dir , null , "dpkg-buildpackage -us -uc" ) ; } catch ( InterruptedException ex ) { throw new IOException ( ex ) ; } return dir ; }
Creates name - version directory creates debian source files and runs dpkg - buildpackage - us - uc