1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160
|
% This file was generated with po4a. Translate the source file.
%
\documentclass[10pt,final]{beamer}
\mode<presentation> \usetheme{debian}
\usepackage{debiantutorial.pt_BR}
\hypersetup{bookmarks}
\title{Tutorial de Empacotamento Debian}
\author[]{Lucas
Nussbaum\\{\small\texttt{packaging-tutorial@packages.debian.org}}\\[1.2em]Tradução
para o português de\\ Tássia\ Camões\ Araújo, Leandro\ Luiz\ Pereira\\e
equipe de tradução para o português do Brasil}
\date{\footnotesize versão 0.29 -- 2021-11-03}
\begin{document}
\frame{\titlepage}
\begin{frame}{Sobre este tutorial}
\begin{itemize}
\item Objetivo: \textbf{dizer o que você realmente precisa saber sobre
empacotamento Debian}
\begin{itemize}
\hbr
\item Modificar pacotes existentes
\hbr
\item Criar os seus próprios pacotes
\hbr
\item Interagir com a comunidade Debian
\hbr
\item Tornar-se um usuário avançado do Debian
\end{itemize}
\br
\item Cobre os pontos mais importantes, mas não é completo
\begin{itemize}
\item Você vai precisar ler mais documentação
\end{itemize}
\br
\item A maioria do conteúdo também se aplica a distribuições derivadas do Debian
\begin{itemize}
\hbr
\item Incluindo Ubuntu
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}{Sumário}
\tableofcontents[hideallsubsections]
\end{frame}
\section{Introdução}
\subsection{Debian}
\begin{frame}{Debian}
\begin{itemize}
\item \textbf{Distribuição GNU/Linux}
\br
\item 1ª grande distribuição desenvolvida ``abertamente no espírito GNU''
\br
\item \textbf{Não-comercial}, construída via colaboração por mais de 1000
voluntários
\br
\item 3 funcionalidades principais:
\begin{itemize}
\item \textbf{Qualidade} -- cultura de excelência técnica\\ {\small\sl Nós
lançamos quando está pronto}
\hbr
\item \textbf{Liberdade} -- desenvolvedores e usuários unidos pelo
\textsl{Contrato Social}\\ Promovendo a cultura do Software Livre desde 1993
\hbr
\item \textbf{Independência} -- nenhuma (única) companhia toma conta do Debian\\ E
processo de tomada de decisão aberto (\textsl{do-ocracy} +
\textsl{democracy})
\end{itemize}
\br
\item \textbf{Amador} no melhor sentido: feito pelo amor de fazê-lo
\end{itemize}
\end{frame}
\subsection{Pacotes Debian}
\begin{frame}{Pacotes Debian}
\begin{itemize}
\item arquivos \textbf{.deb} (pacotes binários)
\br
\item Um método muito poderoso e conveniente de distribuir software aos usuários
\br
\item Um dos dois formatos de pacotes mais comuns (juntamente com o RPM)
\br
\item Universal:
\begin{itemize}
\item 30.000 pacotes binários no Debian\\ $\rightarrow$ a maioria do software
livre disponível é empacotado para Debian!
\hbr
\item Para 12 portes (arquiteturas), incluindo 2 não-Linux (Hurd; KFreeBSD)
\hbr
\item Também usado por 120 distribuições derivadas do Debian
\end{itemize}
\end{itemize}
\end{frame}
\subsection{O formato de pacotes Deb}
\begin{frame}[fragile=singleslide]{O formato de pacotes Deb}
\begin{itemize}
\item Arquivo \texttt{.deb}: um pacote \texttt{ar}
\begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
$ ar tv wget_1.12-2.1_i386.deb
rw-r--r-- 0/0 4 Sep 5 15:43 2010 debian-binary
rw-r--r-- 0/0 2403 Sep 5 15:43 2010 control.tar.gz
rw-r--r-- 0/0 751613 Sep 5 15:43 2010 data.tar.gz
\end{lstlisting} \begin{itemize}
\item \texttt{debian-binary}: versão do formato de arquivo deb,
\texttt{"2.0\textbackslash{}n"}
\item \texttt{control.tar.gz}: meta-dados sobre o pacote\\ {\small
\texttt{\textbf{control}, md5sums, (pre|post)(rm|inst), triggers, shlibs},
\ldots}
\item \texttt{data.tar.gz}: arquivos de dados do pacote
\end{itemize}
\br
\item Você poderia criar os seus arquivos \texttt{.deb} manualmente\\
{\footnotesize
\url{http://tldp.org/HOWTO/html\_single/Debian-Binary-Package-Building-HOWTO/}}
\br
\item Mas a maioria das pessoas não o faz dessa maneira
\end{itemize}
\br
\centerline{\textbf{Neste tutorial: crie pacotes Debian, à maneira Debian}}
\end{frame}
\subsection{Ferramentas que você vai precisar}
\begin{frame}{Ferramentas que você vai precisar}
\begin{itemize}
\item Um sistema Debian (ou Ubuntu) (com acesso root)
\br
\item Alguns pacotes:
\begin{itemize}
\item \textbf{build-essential}: tem dependências nos pacotes que serão assumidos
estar disponíveis na máquina do desenvolvedor (não é preciso especificá-las
no campo \texttt{Build-Depends:} do arquivo control do seu pacote)
\begin{itemize}
\item Inclui uma dependência em \textbf{dpkg-dev}, que contém ferramentas básicas
específicas do Debian para criar pacotes
\end{itemize}
\hbr
\item \textbf{devscripts}: contém muitos scripts úteis para mantenedores Debian
\end{itemize}
\end{itemize}
\br
Muitas outras ferramentas serão também mencionadas mais tarde, tais como
\textbf{debhelper}, \textbf{cdbs}, \textbf{quilt}, \textbf{pbuilder},
\textbf{sbuild}, \textbf{lintian}, \textbf{svn-buildpackage},
\textbf{git-buildpackage}, \ldots\\ Instale-as quando precisar delas.
\end{frame}
\subsection{Fluxo comum de trabalho de empacotamento}
\begin{frame}{Fluxo comum de trabalho de empacotamento}
\begin{center}
\begin{tikzpicture}[
node1/.style={shape=rectangle,draw=rouge,fill=debianbackgroundblue,thick},
arr/.style={very thick}, command/.style={text=rouge,font=\ttfamily}, ]
\node[node1] (www) at (0, 0) {Web}; \node[node1] (us) at (2.5, 0) {fonte
original}; \node[node1] (da) at (-2.5, 0) {mirror Debian}; \node[node1] (sp)
at (0, -2) {pacote fonte}; \draw[arr,<-,dashed,thick] (sp) -- (2.5,-2)
node[right=0cm,text width=2.98cm,text centered,font=\small\sl] {onde a
maioria do trabalho manual é feito}; \node[node1] (bin) at (0, -4) {um ou
vários pacotes binários}; \draw[arr,<-,dashed,thick] (bin) -- (3.5,-4)
node[right,text centered,font=\small\ttfamily\sl] {.deb\normalfont};
\draw[arr,->] (us) -- (sp) node[pos=0.5,right,command] {dh\_make};
\draw[arr,->] (da) -- (sp) node[pos=0.5,left,command] {apt-get source};
\draw[arr,->] (www) -- (sp) node[pos=0.5,left,command] {dget}; \draw[arr,->]
(sp) -- (bin) node[pos=0.5,right,text width=6cm] {\textttc{debuild}
(compilar e testar com \textttc{lintian}) ou \textttc{dpkg-buildpackage}};
\draw[arr,->] (bin) -- (1,-6) node[pos=0.5,right] {instalar
(\textttc{debi})}; \draw[transparent] (bin) -- (-1,-6)
node[pos=0.5,left,opaque] {enviar (\textttc{dput})}; \draw[arr,->,rounded
corners] (bin) -- (-1,-6) -- (-4.5,-6) -- (-4.5,0) -- (da);
\useasboundingbox (-4,-6) rectangle (6,0); \end{tikzpicture}
\end{center}
\end{frame}
\subsection{Recompilando o dash}
\begin{frame}{Exemplo: recompilando o dash}
\begin{enumerate}
\item Instale os pacotes necessários para compilar o dash, e devscripts\\
{\texttt{sudo apt-get build-dep dash}\\ (requer linhas \texttt{deb-src} em
\texttt{/etc/apt/sources.list})}\\ {\texttt{sudo apt-get install
-{}-no-install-recommends devscripts fakeroot}}
\hbr
\item Crie um diretório de trabalho, e entre ele :\\ \texttt{mkdir
/tmp/debian-tutorial ; cd /tmp/debian-tutorial}
\hbr
\item Obtenha o pacote fonte do \texttt{dash}\\ \texttt{apt-get source dash}\\
{\small (Para isto você precisa ter linhas \texttt{deb-src} no seu
\texttt{/etc/apt/sources.list})}
\hbr
\item Compile o pacote\\ {\texttt{cd dash-*\\ debuild -us -uc}} ~~~(\texttt{-us
-uc} desativa a assinatura do pacote com GPG)
\hbr
\item Verifique que funcionou
\begin{itemize}
\item Existem alguns arquivos \texttt{.deb} novos no diretório anterior
\end{itemize}
\hbr
\item Observe o diretório \texttt{debian/}
\begin{itemize}
\item É aí que o trabalho de empacotamento é feito
\end{itemize}
\end{enumerate}
\end{frame}
\section{Criando pacotes fonte}
\subsection{Fundamentos sobre pacotes fonte}
\begin{frame}{Pacote fonte}
\begin{itemize}
\item Um pacote fonte pode gerar vários pacotes binários\\ {\small p. ex. o fonte
\texttt{\bfseries libtar} gera os pacotes binários \texttt{\bfseries
libtar0} e \texttt{\bfseries libtar-dev}} \hbr
\item Dois tipos de pacotes: (em dúvida, use não-nativo)
\begin{itemize}
\small
\item Pacotes nativos: normalmente para software específico do Debian
(\textsl{dpkg}, \textsl{apt})
\item Pacotes não-nativos: software desenvolvido fora do Debian
\end{itemize}
\hbr
\item Arquivo principal: \texttt{.dsc} (meta-dados)
\hbr
\item Outros arquivos dependendo da versão do formato do fonte
\begin{itemize}
\item 1.0 ou 3.0 (nativo): \texttt{package\_version.tar.gz}
\hbr
\item 1.0 (não-nativo):
\begin{itemize}
\item \texttt{pkg\_ver.orig.tar.gz}: fonte do original (upstream)
\item \texttt{pkg\_debver.diff.gz}: patch para adicionar alterações específicas do
Debian
\end{itemize}
\hbr
\item 3.0 (quilt):
\begin{itemize}
\item \texttt{pkg\_ver.orig.tar.gz}: fonte do original (upstream)
\item \texttt{pkg\_debver.debian.tar.gz}: tarball com alterações do Debian
\end{itemize}
\end{itemize}
\end{itemize}
\hbr
(Veja \texttt{dpkg-source(1)} para detalhes exatos)
\end{frame}
\begin{frame}[fragile=singleslide]{Exemplo de pacote fonte (wget\_1.12-2.1.dsc)}
\begin{lstlisting}[basicstyle=\ttfamily\small]
Format: 3.0 (quilt)
Source: wget
Binary: wget
Architecture: any
Version: 1.12-2.1
Maintainer: Noel Kothe <noel@debian.org>
Homepage: http://www.gnu.org/software/wget/
Standards-Version: 3.8.4
Build-Depends: debhelper (>> 5.0.0), gettext, texinfo,
libssl-dev (>= 0.9.8), dpatch, info2man
Checksums-Sha1:
50d4ed2441e67[..]1ee0e94248 2464747 wget_1.12.orig.tar.gz
d4c1c8bbe431d[..]dd7cef3611 48308 wget_1.12-2.1.debian.tar.gz
Checksums-Sha256:
7578ed0974e12[..]dcba65b572 2464747 wget_1.12.orig.tar.gz
1e9b0c4c00eae[..]89c402ad78 48308 wget_1.12-2.1.debian.tar.gz
Files:
141461b9c04e4[..]9d1f2abf83 2464747 wget_1.12.orig.tar.gz
e93123c934e3c[..]2f380278c2 48308 wget_1.12-2.1.debian.tar.gz
\end{lstlisting}
\end{frame}
\subsection{Obtendo pacotes fonte}
\begin{frame}{Obtendo um pacote fonte existente}
\begin{itemize}
\item Do repositório Debian:
\begin{itemize}
\item \texttt{apt-get source \textsl{pacote}}
\item \texttt{apt-get source \textsl{pacote=versão}}
\item \texttt{apt-get source \textsl{pacote/lançamento}}
\end{itemize}
(Você precisa de linhas \texttt{deb-src} no \texttt{sources.list})
\br
\item Da Internet:
\begin{itemize}
\item \texttt{dget \textsl{url-to.dsc}}
\item \texttt{dget
http://snapshot.debian.org/archive/debian-archive/\\20090802T004153Z/debian/dists/bo/main/source/web/\\
wget\_1.4.4-6.dsc}\\ (\href{http://snapshot.debian.org/}{\ttfamily
snapshot.d.o} disponibiliza todos os pacotes Debian desde 2005)
\end{itemize}
\br
\item Do sistema de controle de versão (declarado):
\begin{itemize}
\item \texttt{debcheckout \textsl{pacote}}
\end{itemize}
\br
\item Uma vez baixado, extraia com \texttt{dpkg-source -x \textsl{file.dsc}}
\end{itemize}
\end{frame}
\subsection{Criando um pacote fonte básico}
\begin{frame}{Criando um pacote fonte básico}
\begin{itemize}
\item Baixe o fonte original (upstream)\\ (\textsl{fonte upstream} = aquele dos
desenvolvedores originais do software)
\hbr
\item Renomeie para
\texttt{<\textsl{pacote\_fonte}>\_<\textsl{versão\_original}>.orig.tar.gz}\\
(exemplo: \texttt{simgrid\_3.6.orig.tar.gz})
\hbr
\item Descompacte-o
\hbr
\item Renomeie o diretório para
\texttt{<\textsl{pacote\_fonte}>-<\textsl{versão\_original}>}\\ (exemplo:
\texttt{simgrid-3.6})
\hbr
\item \texttt{cd \texttt{<\textsl{pacote\_fonte}>-<\textsl{versão\_original}>}
\&\& dh\_make}\\ (do pacote \textbf{dh-make})
\hbr
\item Existem algumas alternativas ao \texttt{dh\_make} para conjuntos de pacotes
específicos: \textbf{dh-make-perl}, \textbf{dh-make-php}, \ldots \hbr
\item Diretório \texttt{debian/} criado, com muitos arquivos dentro dele
\end{itemize}
\end{frame}
\subsection{Arquivos em debian/}
\begin{frame}{Arquivos em debian/}
Todo o empacotamento deve ser feito modificando-se arquivos em
\texttt{debian/}
\hbr
\begin{itemize}
\item Arquivos principais:
\begin{itemize}
\item \textbf{control} -- meta-dados sobre o pacote (dependências, etc)
\item \textbf{rules} -- especifica como compilar o pacote
\item \textbf{copyright} -- informação de copyright para o pacote
\item \textbf{changelog} -- história do pacote Debian
\end{itemize}
\hbr
\item Outros arquivos:
\begin{itemize}
\item compat
\item watch
\item dh\_install* targets\\ {\small *.dirs, *.docs, *.manpages, \ldots}
\item scripts do mantenedor\\ {\small *.postinst, *.prerm, \ldots}
\item source/format
\item patches/ -- se você precisar modificar os fontes do autor original
\end{itemize}
\hbr
\item Vários arquivos usam formato baseado em RFC 822 \small (cabeçalhos de email)
\end{itemize}
\end{frame}
\begin{frame}[fragile=singleslide]{debian/changelog}
\begin{itemize}
\item Lista as alterações do empacotamento Debian
\item Determina a versão atual do pacote
\begin{center}
\begin{tikzpicture}
\draw (0,0) node[above right] {\large 1.2.1.1-5}; \draw
[decorate,decoration={brace}] (2,0) -- (1.45,0) node[at start,below,text
width=1.6cm,text centered] {\small Revisão Debian}; \draw
[decorate,decoration={brace}] (1.4,0) -- (0,0) node[midway,below,text
width=1.6cm,text centered] { \small Versão original};
\end{tikzpicture}
\end{center}
\item Editado manualmente ou com \textttc{dch}
\begin{itemize}
\item Crie uma entrada no changelog para um novo lançamento: \textttc{dch -i}
\end{itemize}
\item Formato especial para fechar automaticamente bugs do Debian ou
Ubuntu. Debian: \texttt{Closes:~\#595268}; Ubuntu: \texttt{LP:~\#616929}
\item Instalado como \texttt{/usr/share/doc/\textit{pacote}/changelog.Debian.gz}
\end{itemize}
\seprule
\begin{lstlisting}[basicstyle=\ttfamily\scriptsize]
mpich2 (1.2.1.1-5) unstable; urgency=low
* Use /usr/bin/python instead of /usr/bin/python2.5. Allow
to drop dependency on python2.5. Closes: #595268
* Make /usr/bin/mpdroot setuid. This is the default after
the installation of mpich2 from source, too. LP: #616929
+ Add corresponding lintian override.
-- Lucas Nussbaum <lucas@debian.org> Wed, 15 Sep 2010 18:13:44 +0200
\end{lstlisting}
\end{frame}
\begin{frame}[fragile=singleslide]{debian/control}
\hbr
\begin{itemize}
\item Meta-dados do pacote
\begin{itemize}
\item Para o próprio pacote fonte
\item Para cada pacote binário compilado deste fonte
\end{itemize}
\hbr
\item Nome do pacote, seção, prioridade, mantenedor, desenvolvedores que fazem
uploads, dependências de compilação, dependências, descrição, página do
projeto, \ldots \hbr
\item Documentação: Debian Policy capítulo 5\\
\url{https://www.debian.org/doc/debian-policy/ch-controlfields}
\end{itemize}
\seprule
\begin{lstlisting}[basicstyle=\ttfamily\scriptsize]
Source: wget
Section: web
Priority: important
Maintainer: Noel Kothe <noel@debian.org>
Build-Depends: debhelper (>> 5.0.0), gettext, texinfo,
libssl-dev (>= 0.9.8), dpatch, info2man
Standards-Version: 3.8.4
Homepage: http://www.gnu.org/software/wget/
Package: wget
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: retrieves files from the web
Wget is a network utility to retrieve files from the Web
\end{lstlisting}
\end{frame}
\begin{frame}{Arquitetura: todas (\textit{all}) ou qualquer uma (\textit{any})}
Dois tipos de pacotes binários:
\hbr
\begin{itemize}
\item Pacotes com conteúdos diferentes em cada arquitectura Debian
\begin{itemize}
\item Exemplo: programa C
\item \texttt{Architecture:\ any} em \texttt{debian/control}
\begin{itemize}
\item Ou, se apenas funcionar num sub-conjunto de arquiteturas:\\
\texttt{Architecture:\ amd64 i386 ia64 hurd-i386}
\end{itemize}
\item buildd.debian.org: compila para todas as outras arquiteturas no upload
\item Chamado \texttt{\textsl{pacote}\_\textsl{versão}\_\textsl{arquitetura}.deb}
\end{itemize}
\br
\item Pacotes com o mesmo conteúdo para todas as arquiteturas
\begin{itemize}
\item Exemplo: biblioteca Perl
\item \texttt{Architecture:\ all} em \texttt{debian/control}
\item Chamado \texttt{\textsl{pacote}\_\textsl{versão}\_\textbf{all}.deb}
\end{itemize}
\end{itemize}
\br
Um pacote fonte pode gerar uma mistura de pacotes binários de
\texttt{Arquitecture:\ any} e \texttt{Arquitecture:\ all}
\end{frame}
\begin{frame}[fragile=singleslide]{debian/rules}
\hbr
\begin{itemize}
\item Makefile
\br
\item Interface usada para compilar pacotes Debian
\br
\item Documentado na Debian Policy, capitulo 4.8\\ {\small
\url{https://www.debian.org/doc/debian-policy/ch-source\#s-debianrules}}
\br
\item Alvos necessários:
\begin{itemize}
\item \texttt{build, build-arch, build-indep}: deve executar toda a configuração e
compilação
\hbr
\item \texttt{binary, binary-arch, binary-indep}: compila os pacotes binários
\begin{itemize}
\item \texttt{dpkg-buildpackage} vai chamar \texttt{binary} para compilar todos os
pacotes, ou \texttt{binary-arch} para compilar apenas os pacotes de
\texttt{Arquitecture:~any}
\end{itemize}
\hbr
\item \texttt{clean}: limpa o diretório do código fonte
\end{itemize}
\end{itemize}
\end{frame}
\subsection{Ajudantes de empacotamento}
\begin{frame}{Ajudantes de empacotamento -- debhelper}
\begin{itemize}
\item Você poderia escrever código shell diretamente em \texttt{debian/rules}
\item Melhor prática (mais popular): use um \textsl{Ajudante de empacotamento}
\item O mais popular: \textbf{debhelper} (usado por 98\% dos pacotes)
\item Objetivos:
\begin{itemize}
\item \small Dividir tarefas comuns em ferramentas padrão usadas por todos os
pacotes
\item Corrigir bugs de empacotamento de uma vez para todos os pacotes
\end{itemize}{\footnotesize dh\_installdirs, dh\_installchangelogs, dh\_installdocs,
dh\_install, dh\_installdebconf, dh\_installinit, dh\_link, dh\_strip,
dh\_compress, dh\_fixperms, dh\_perl, dh\_makeshlibs, dh\_installdeb,
dh\_shlibdeps, dh\_gencontrol, dh\_md5sums, dh\_builddeb, \ldots}
\begin{itemize}
\item Chamado a partir de \texttt{debian/rules}
\item Configurável usando parâmetros de comandos ou arquivos em \texttt{debian/}
\end{itemize}{\footnotesize \ttfamily \textsl{pacote}.docs, \textsl{pacote}.examples,
\textsl{pacote}.install, \textsl{pacote}.manpages, \ldots} \hbr
\item Ajudantes de terceiros para conjuntos de pacotes: {\scriptsize
\textbf{python-support}, \textbf{dh\_ocaml}, \ldots} \hbr
\item \texttt{debian/compat}: Versão de compatibilidade do Debhelper
\begin{itemize}
\item Define comportamento preciso de dh\_*
\item Nova sintaxe: \texttt{Build-Depends: debhelper-compat (= 13)}
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}[fragile=singleslide]{debian/rules usando debhelper (1/2)}
\begin{lstlisting}[basicstyle=\ttfamily\footnotesize,escapeinside=\{\}]
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
build:
$(MAKE)
#docbook-to-man debian/packagename.sgml > packagename.1
clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
$(MAKE) clean
dh_clean
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
# Add here commands to install the package into debian/packagename.
$(MAKE) DESTDIR=$(CURDIR)/debian/packagename install
\end{lstlisting}
\end{frame}
\begin{frame}[fragile=singleslide]{debian/rules usando debhelper (2/2)}
\begin{lstlisting}[basicstyle=\ttfamily\footnotesize,escapeinside=\{\}]
# Build architecture-independent files here.
binary-indep: build install
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir
dh_testroot
dh_installchangelogs
dh_installdocs
dh_installexamples
dh_install
dh_installman
dh_link
dh_strip
dh_compress
dh_fixperms
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure
\end{lstlisting}
\end{frame}
\begin{frame}[fragile=singleslide]{CDBS}
\hbr
\begin{itemize}
\item Com o debhelper, ainda tem bastante redundância entre pacotes
\hbr
\item Ajudantes de segundo-nível que extraem funcionalidades comuns
\begin{itemize}
\item \small P. ex. compilando com \texttt{./configure \&\& make \&\& make
install} ou CMake
\end{itemize}
\hbr
\item CDBS:
\begin{itemize}
\item \small Introduzido em 2005, baseado na magia avançada do \textsl{GNU make}
\item Documentação: \texttt{/usr/share/doc/cdbs/}
\item Suporte para Perl, Python, Ruby, GNOME, KDE, Java, Haskell, \ldots
\item Porém existem pessoas que o detestam:
\begin{itemize}
\item \small Às vezes é difícil personalizar compilações de pacotes:\\
"\textsl{labirinto enrolado de makefiles e variáveis de ambiente}"
\item Mais lento que o debhelper puro (muitas chamadas desnecessárias a
\texttt{dh\_*})
\end{itemize}
\end{itemize}
\end{itemize}
\seprule
\begin{lstlisting}[basicstyle=\ttfamily\footnotesize,escapeinside=\{\}]
#!/usr/bin/make -f
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk
# add an action after the build
build/mypackage::
/bin/bash debian/scripts/foo.sh
\end{lstlisting}
\end{frame}
\begin{frame}[fragile=singleslide]{Dh (ou Debhelper 7, ou dh7)}
\begin{itemize}
\item Introduzido em 2008 como um \textsl{matador do CDBS}
\hbr
\item comando \textbf{dh} que chama \texttt{dh\_*}
\hbr
\item \textsl{debian/rules} simples, listando apenas as sobreposições
\hbr
\item Mais fácil de personalizar que o CDBS
\hbr
\item Doc: manpages (\texttt{debhelper(7)}, \texttt{dh(1)}) + slides da palestra
na DebConf9\\
\url{http://kitenet.net/~joey/talks/debhelper/debhelper-slides.pdf}
\end{itemize}
\seprule
\begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
#!/usr/bin/make -f
%:
dh $@
override_dh_auto_configure:
dh_auto_configure -- --with-kitchen-sink
override_dh_auto_build:
make world
\end{lstlisting}
\end{frame}
\begin{frame}{debhelper clássico versus CDBS versus dh}
\hbr
\begin{itemize}
\item Popularidade:\\ debhelper clássico: 15\% \hskip 1em CDBS: 15\% \hskip 1em
dh: 68\%
\hbr
\item Qual deles devo aprender?
\begin{itemize}
\item Provavelmente um pouco de todos eles
\item Você precisa conhecer o debhelper para usar o dh e o CDBS
\item Você pode ter que modificar pacotes CDBS
\end{itemize}
\hbr
\item Qual deles devo usar para um pacote novo?
\begin{itemize}
\item \textbf{dh} (única solução com um aumento de popularidade)
\item Veja \url{https://trends.debian.net/\#build-systems}
\end{itemize}
\end{itemize}
\hbr
\end{frame}
\section{Compilando e testando pacotes}
\subsection{Compilando pacotes}
\begin{frame}{Compilando pacotes}
\begin{itemize}
\item \textttc{apt-get build-dep meupacote}\\ Instala as
\textsl{build-dependencies} (para um pacote já no Debian)\\ Ou
\textttc{mk-build-deps -ir} (para um pacote ainda não submetido)
\br
\item \textttc{debuild}: compila, testa com \texttt{lintian}, assina com GPG
\br
\item Também é possível chamar diretamente \textttc{dpkg-buildpackage}
\begin{itemize}
\item Normalmente com \texttt{dpkg-buildpackage -us -uc}
\end{itemize}
\br
\item É melhor compilar os pacotes num ambiente limpo \& mínimo
\begin{itemize}
\item \textttc{pbuilder} -- ajudante para compilar pacotes num \textsl{chroot}\\
Boa documentação: \url{https://wiki.ubuntu.com/PbuilderHowto}\\ (otimização:
\textttc{cowbuilder} \textttc{ccache} \textttc{distcc})
\hbr
\item \textttc{schroot} e \textttc{sbuild}: usados nos daemons de compilação do
Debian\\ (não tão simples quanto \texttt{pbuilder}, mas permite snapshots
LVM\\ veja: \url{https://help.ubuntu.com/community/SbuildLVMHowto} )
\end{itemize}
\br
\item Gera arquivos \texttt{.deb} e um arquivo \texttt{.changes}
\begin{itemize}
\item \texttt{.changes}: descreve o que foi compilado; usado para fazer o upload
do pacote
\end{itemize}
\end{itemize}
\end{frame}
\subsection{Instalando e testando pacotes}
\begin{frame}{Instalando e testando pacotes}
\begin{itemize}
\item Instale o pacote localmente: \textttc{debi} (\texttt{.changes} vai dizer o
que instalar) \br
\item Liste o conteúdo do pacote: \texttt{{\color{rouge}debc}
../mypackage<TAB>.changes} \br
\item Compare o pacote com a versão anterior:\\ \texttt{{\color{rouge}debdiff}
../mypackage\_1\_*.changes ../mypackage\_2\_*.changes}\\ ou para comparar os
fontes:\\ \texttt{{\color{rouge}debdiff} ../mypackage\_1\_*.dsc
../mypackage\_2\_*.dsc}\\
\br
\item Verifique o pacote com \texttt{lintian} (analisador estático):\\
\texttt{{\color{rouge}lintian} ../mypackage<TAB>.changes}\\ \texttt{lintian
-i}: fornece mais informação sobre os erros \\ \texttt{lintian -EviIL
+pedantic}: mostra mais problemas\br
\item Faça o upload do pacote para o Debian (\textttc{dput}) (precisa de
configuração) \br
\item Gerencie um repositório Debian privado com \textttc{reprepro} ou
\textttc{aptly}\\ Documentação:
\url{https://wiki.debian.org/HowToSetupADebianRepository}
\end{itemize}
\end{frame}
\section{Sessão prática 1: modificando o pacote grep}
\begin{frame}{Sessão prática 1: modificando o pacote grep}
\begin{enumerate}
\item Visite \url{http://ftp.debian.org/debian/pool/main/g/grep/} e baixe a versão
2.12-2 do pacote
\begin{itemize}
\item Se o pacote fonte não descompactar automaticamente, descompacte-o com
\texttt{dpkg-source~-x~grep\_*.dsc}
\end{itemize}
\item Observe os arquivos em \texttt{debian/}
\begin{itemize}
\item Quantos pacotes binários são gerados por este pacote fonte?
\item Qual ajudante de empacotamento este pacote usa?
\end{itemize}
\hbr
\item Compile o pacote
\hbr
\item Agora vamos modificar o pacote. Adicione uma entrada no changelog e
incremente o número da versão.
\hbr
\item Agora desative o suporte a perl-regexp (uma opção do \texttt{./configure})
\hbr
\item Re-compile o pacote
\hbr
\item Compare os pacotes original e novo com o debdiff
\hbr
\item Instale o pacote que acaba de ser compilado
\end{enumerate}
\end{frame}
\section{Tópicos avançados de empacotamento}
\subsection{debian/copyright}
\begin{frame}[fragile=singleslide]{debian/copyright}
\hbr
\begin{itemize}
\item Informação de copyright e licença para o fonte e o empacotamento
\item Tradicionalmente escrito num arquivo texto
\item Novo formato legível por máquina:
{\small\url{https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/}}
\end{itemize}
\seprule
\begin{lstlisting}[basicstyle=\ttfamily\scriptsize]
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: X Solitaire
Source: ftp://ftp.example.com/pub/games
Files: *
Copyright: Copyright 1998 John Doe <jdoe@example.com>
License: GPL-2+
This program is free software; you can redistribute it
[...]
.
On Debian systems, the full text of the GNU General Public
License version 2 can be found in the file
`/usr/share/common-licenses/GPL-2'.
Files: debian/*
Copyright: Copyright 1998 Jane Smith <jsmith@example.net>
License:
[LICENSE TEXT]
\end{lstlisting}
\end{frame}
\subsection{Modificando o fonte do original}
\begin{frame}{Modificando o fonte do original}
Muitas vezes necessário:
\begin{itemize}
\item Corrigir bugs ou adicionar alterações que são específicas do Debian
\hbr
\item Correções em versões anteriores (\textit{backport fixes}) a partir de
lançamento mais recente do autor original
\end{itemize}
\br
Vários métodos para fazer isso:
\begin{itemize}
\item Modificando os arquivos diretamente
\begin{itemize}
\item Simples
\item Mas não permite acompanhar e documentar as alterações
\end{itemize}
\hbr
\item Utilizando sistemas de patch
\begin{itemize}
\item Facilita a contribuição de suas alterações para o autor original
(\textit{upstream})
\item Ajuda a compartilhar as correções com distribuições derivadas do Debian
\item Dá mais visibilidade às alterações\\ \url{http://patch-tracker.debian.org/}
(no momento, fora de serviço)
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}{Sistemas de patch}
\begin{itemize}
\item Princípio: alterações são guardadas como patches em \texttt{debian/patches/}
\br
\item Aplicado e retirado durante a compilação
\br
\item Antes: várias implementações -- \textsl{simple-patchsys} (\textsl{cdbs}),
\textsl{dpatch}, \textbf{\textsl{quilt}}
\begin{itemize}
\item Cada um suporta dois alvos \texttt{debian/rules}:
\begin{itemize}
\item \texttt{debian/rules patch}: aplica todos os patches
\item \texttt{debian/rules unpatch}: retira as alterações de todos os patches
\end{itemize}
\hbr
\item Mais documentação: \url{https://wiki.debian.org/debian/patches}
\end{itemize}
\br
\item \textbf{\small Novo formato de pacote fonte com sistema de patch integrado: 3.0
(quilt)}
\begin{itemize}
\item Solução recomendada
\hbr
\item Você precisa aprender \textsl{quilt}\\
\url{http://perl-team.pages.debian.net/howto/quilt.html}
\hbr
\item Ferramenta em \texttt{devscripts} independente do sistema de patch usado:
\texttt{edit-patch}
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}[fragile=singleslide]{Documentação de patches}
\begin{itemize}
\item Cabeçalhos padrão no inicio do patch
\br
\item Documentado em DEP-3 - Patch Tagging Guidelines\\
\url{http://dep.debian.net/deps/dep3/}
\end{itemize}
\vfill
\seprule
\begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
Description: Fix widget frobnication speeds
Frobnicating widgets too quickly tended to cause explosions.
Forwarded: http://lists.example.com/2010/03/1234.html
Author: John Doe <johndoe-guest@users.alioth.debian.org>
Applied-Upstream: 1.2, http://bzr.foo.com/frobnicator/revision/123
Last-Update: 2010-03-29
--- a/src/widgets.c
+++ b/src/widgets.c
@@ -101,9 +101,6 @@ struct {
\end{lstlisting}
\end{frame}
\subsection{\large Tomando ações durante instalação e remoção}
\begin{frame}{\large Tomando ações durante instalação e remoção}
\begin{itemize}
\item Descompactar o pacote às vezes não é suficiente
\hbr
\item Criar/remover usuários do sistema, iniciar/parar serviços, gerenciar
\textsl{alternatives}
\hbr
\item Feito nos \textsl{scripts do mantenedor}\\ \texttt{preinst, postinst, prerm,
postrm}
\begin{itemize}
\item \small Trechos de código para ações comuns podem ser gerados pelo debhelper
\end{itemize}
\hbr
\item Documentação:
\begin{itemize}
\item Manual de Políticas Debian (Debian Policy), capítulo 6\\ {\footnotesize
\url{https://www.debian.org/doc/debian-policy/ch-maintainerscripts}}
\hbr
\item Referência dos Desenvolvedores Debian, capítulo 6.4\\ {\scriptsize
\url{https://www.debian.org/doc/developers-reference/best-pkging-practices.html}}
\hbr
\item {\footnotesize
\url{https://people.debian.org/~srivasta/MaintainerScripts.html}}
\end{itemize}
\br
\item Questionando o usuário
\begin{itemize}
\item Precisa ser feito com \textbf{debconf}
\hbr
\item Documentação: \texttt{debconf-devel(7)} (pacote \texttt{debconf-doc})
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}[fragile=singleslide]{\large Monitorando versões do autor original (\textit{upstream})}
\begin{itemize}
\item Especifique onde procurar em \texttt{debian/watch} (veja \texttt{uscan(1)})
\begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
version=3
http://tmrc.mit.edu/mirror/twisted/Twisted/(\d\.\d)/ \
Twisted-([\d\.]*)\.tar\.bz2
\end{lstlisting}
\br
\item Existem seguidores automáticos de novas versões do original, que notificam o
mantenedor em vários painéis de controle incluindo
\url{https://tracker.debian.org/} e \url{https://udd.debian.org/dmd/}
\br
\item \texttt{uscan}: executa uma verificação manual
\br
\item \texttt{uupdate}: tenta atualizar o seu pacote para a versão mais recente do
autor original
\end{itemize}
\end{frame}
\subsection{Empacotando com Sistema de Controle de Versão (SVN, Git)}
\begin{frame}[fragile=singleslide]{\large Empacotando com Sistema de Controle de Versão}
\begin{itemize}
\item Várias ferramentas para ajudar a gerenciar branches e tags:\\
\texttt{svn-buildpackage}, \texttt{git-buildpackage}
\hbr
\item Exemplo: \texttt{git-buildpackage}
\begin{itemize}
\item \small \texttt{upstream} branch que acompanha upstream com tags
\texttt{upstream/\textsl{version}}
\item \texttt{master} branch que acompanha o pacote Debian
\item \texttt{debian/\textsl{version}} tags para cada envio (\textit{upload})
\item \texttt{pristine-tar} branch para a recompilação do tarball original
\end{itemize}
Doc:
\url{http://honk.sigxcpu.org/projects/git-buildpackage/manual-html/gbp.html}
\hbr
\item Campos \texttt{Vcs-*} em \texttt{debian/control} para localizar o
repositório
\begin{itemize}
\item \url{https://wiki.debian.org/Salsa}
\end{itemize}
\end{itemize}
\begin{lstlisting}[basicstyle=\ttfamily\scriptsize]
Vcs-Browser: https://salsa.debian.org/debian/devscripts
Vcs-Git: https://salsa.debian.org/debian/devscripts.git
\end{lstlisting}
\begin{lstlisting}[basicstyle=\ttfamily\scriptsize]
Vcs-Browser: https://salsa.debian.org/perl-team/modules/packages/libwww-perl
Vcs-Git: https://salsa.debian.org/perl-team/modules/packages/libwww-perl.git
\end{lstlisting}
\begin{itemize}
\item Interface independente de VCS: \texttt{debcheckout}, \texttt{debcommit},
\texttt{debrelease}\\
\begin{itemize}
\item \texttt{debcheckout grep} $\rightarrow$ obtém o pacote fonte do Git
\end{itemize}
\end{itemize}
\end{frame}
\subsection{\large Empacotando para sistemas antigos (\textit{backporting})}
\begin{frame}{\large Empacotando para sistemas antigos (\textit{backporting})}
\begin{itemize}
\item Objetivo: usar uma nova versão de um pacote num sistema mais antigo\\
p.ex. usar \textsl{mutt} do Debian \textsl{unstable} no Debian
\textsl{stable}
\br
\item Ideia geral:
\begin{itemize}
\item Obtenha o pacote fonte do Debian unstable
\hbr
\item Modifique-o para que compile e funcione bem no Debian stable
\begin{itemize}
\item Às vezes isso é trivial (sem alterações necessárias)
\item Às vezes é difícil
\item Às vezes é impossível (muitas dependências não disponíveis)
\end{itemize}
\end{itemize}
\br
\item Alguns ``backports'' são disponibilizados e mantidos pelo projeto Debian\\
\url{http://backports.debian.org/}
\end{itemize}
\end{frame}
\section{Mantendo pacotes no Debian}
\subsection{Repositório e suítes Debian}
\begin{frame}{Repositório e suítes Debian}
\begin{center}
\resizebox{\textwidth}{!}{
\begin{tikzpicture}[
people/.style={shape=ellipse,draw,thick},
suite/.style={shape=rectangle,draw},
devel/.style={fill=red!30!white},
test/.style={fill=orange!30!white},
prod/.style={fill=green!30!white,node distance=2cm},
internal/.style={},
old/.style={fill=gray!30!white},
veryold/.style={fill=gray!70!white},
arr/.style={very thick},
uploads/.style={decorate,decoration={snake,amplitude=.4mm,segment length=2mm,post length=1mm}},
migrations/.style={};
command/.style={text=rouge,font=\ttfamily},
legend/.style={font=\small}
]
\draw node[suite,prod] (sec) {security}; \draw node[suite,prod,right=of sec]
(su) {stable-updates}; \draw node[suite,prod,right=of su] (st) {stable};
\draw node[suite,old,node distance=0.3cm,below=of st] (os) {oldstable};
\draw node[suite,veryold,node distance=0.3cm,below=of os] (ar)
{archive.d.o}; \draw node[suite,prod,right=of st] (bp) {backports}; \draw
node[suite,test] (spu) at ($(su) + (-0.6,2.5)$) {stable-proposed-updates};
\draw node[suite,internal] (sn) at ($(st) + (-1.7,1.4)$) {stable-new}; \draw
node[suite,test,node distance=1.5cm,above=of st] (te) {testing}; \draw
node[suite,devel,above=of te] (sid) {unstable}; \draw node[suite,devel]
(exp) at ($(sid) + (2.5,0.5)$) {experimental}; \draw node[suite,devel] (tpu)
at ($(te)!0.5!(sid) + (2.5,0)$) {testing-proposed-updates}; \draw
node[people,above=of sid] (dd) {desenvolvedor}; \draw node[people,node
distance=3cm,left=of dd] (secteam) {time de segurança};
\draw[arr,uploads,->] (dd) -- (sid); \draw[arr,uploads,->] (dd) -- (exp);
\draw[arr,uploads,->,bend right=8] (dd) to (tpu); \draw[arr,uploads,->]
(secteam) -- (sid); \draw[arr,uploads,->] (secteam) -- (sec);
\draw[arr,uploads,->] (dd) to (spu); \draw[arr,uploads,->] plot [smooth,
tension=0.75] coordinates { (dd.east) ($(exp.north east)+(0.1,0.1)$)
($(tpu.east)+(0.2,0)$) ($(bp.north east) + (-0.4,0)$) };
\draw[arr,migrations,->] (tpu) -- (te); \draw[arr,migrations,->] (sid) --
(te); \draw[arr,migrations,->] (te) -- (st) node
[midway,align=left,midway,right,font=\footnotesize] {lançamento\\da stable};
\draw[arr,migrations,->] (sec) -- (sn); \draw[arr,migrations,->] (sn) to
node [pos=0.2] (spulabel) {} (st); \draw
node[font=\footnotesize,align=right] at ($(spulabel) + (-0.40,-0.73)$)
{lançamento \\ pontual \\ \emph{(point release)}}; \draw[arr,migrations,->]
(spu) to (sn); \draw[arr,migrations,->] (spu) -- (su);
\draw[arr,migrations,->] (st) -- (os); \draw[arr,migrations,->] (os) --
(ar); \coordinate (legend) at (-2,-1); \draw[arr,uploads,->] (legend) --
($(legend) + (0.7,0)$) node [right,legend] {upload de pacotes};
\coordinate[node distance=1.1em,below=of legend] (legend2);
\draw[arr,migrations,->] (legend2) -- ($(legend2) + (0.7,0)$) node
[right,legend] {migração de pacotes entre suítes}; \coordinate[node
distance=1.5em,below=of legend2] (legend3); \draw
node[right,suite,devel,legend] (ldev) at (legend3) {desenvolvimento}; \draw
node[node distance=0.1cm,right=of ldev,suite,test,legend] (ltest) {teste};
\draw node[node distance=0.1cm,right=of ltest,suite,internal,legend] (lint)
{interno}; \draw node[node distance=0.1cm,right=of lint,suite,prod,legend]
(lprod) {produção}; \draw ($(legend.north west) + (-0.1,0.25)$) rectangle
($(lprod.south east) + (0.1,-0.1)$); \draw
node[font=\bf,red!70!white,align=center] (tnext) at ($(te.east) + (2,-0.1)$)
{{\small preparação do próximo} \\{\small lançamento}}; \draw
node[font=\bf,green!70!black,align=center] (tsrm) at ($(sec.north east) +
(1,1)$) {\small gestão de um\\ \small lançamento\\ \small da stable};
\pgfdeclarelayer{background} \pgfdeclarelayer{foreground}
\pgfsetlayers{background,main,foreground}
\begin{pgfonlayer}{background}
\fill[red!10!white] plot [smooth cycle,tension=0.55] coordinates {
($(sid.north west) + (-0.1,0.1)$) ($(exp.north east)+(0.1,0.1)$)
($(tpu.south east)+(0.1,-0.1)$) ($(tnext.south) + (0.6,0)$) ($(te.south
west) + (0.1,-0.1)$) }; \fill[green!10!white] plot [smooth
cycle,tension=0.55] coordinates { ($(spu.north west) + (-0.1,0.1)$)
($(spu.north east)+(0.1,0.1)$) ($(sn.north east)+(0.1,0.1)$) ($(st.north
east) + (0.1,0.5)$) ($(bp.north east) + (0.1,0.1)$) ($(bp.south east) +
(0.1,-0.1)$) ($(sec.south west) + (-0.1,-0.1)$) };
\end{pgfonlayer}
\end{tikzpicture}
}
\end{center}
\begin{flushright}
\tiny Baseado no grafo de Antoine
Beaupr\'e. \url{https://salsa.debian.org/debian/package-cycle}~~~~~~~~~~~~
\end{flushright}
\end{frame}
\begin{frame}{Suítes de desenvolvimento}
\begin{itemize}
\item Novas versões de pacotes são enviadas para \textbf{unstable} (\textbf{sid})
\hbr
\item Pacotes migram da \textbf{unstable} para \textbf{testing} com base em
diversos critérios (p.ex. estar na unstable por 10 dias, e sem regressão)
\hbr
\item Novos pacotes também podem ser submetidos para:
\begin{itemize}
\item \textbf{experimental} (para pacotes mais \textsl{experimentais}, como quando
a nova versão não está pronta para substituir a que está na unstable)
\hhbr
\item \textbf{testing-proposed-updates}, para atualizar a versão na
\textbf{testing} sem passar pela \textbf{unstable} (raramente usado)
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}{Congelando e lançando}
\begin{itemize}
\item Em algum momento do ciclo, o time de lançamento (\emph{release} team) decide
congelar (\textsl{freeze}) a testing: migrações automáticas da
\textbf{unstable} para \textbf{testing} são paradas e substituídas por
revisão manual
\br
\item Quando o time de release considera a \textbf{testing} pronta para
lançamento:
\begin{itemize}
\item A suíte \textbf{testing} torna-se a nova suíte \textbf{stable}
\hhbr
\item Similarmente, a que era \textbf{stable} torna-se \textbf{oldstable}
\hhbr
\item Lançamentos não mais mantidos são movidos para \texttt{archive.debian.org}
\end{itemize}
\br
\item Veja \url{https://release.debian.org/}
\end{itemize}
\end{frame}
\begin{frame}{Suítes e gestão da versão stable}
\begin{itemize}
\item Diversas suítes proveem pacotes para a versão stable:
\hhbr
\begin{itemize}
\item \small \textbf{stable}: a suíte principal
\hbr
\item suíte de atualizações de \textbf{segurança} disponibilizada em
\texttt{security.debian.org}, usada pelo time de segurança. Atualizações são
anunciadas na lista de discussão \texttt{debian-security-announce}
\hbr
\item \textbf{stable-updates}: atualizações que não de segurança, mas que deveriam
ser instaladas urgentemente (sem esperar pelo próximo lançamento pontual
(\emph{stable point release}): banco de dados de anti-virus, pacotes
relacionados a fuso horário, etc. Anunciadas na lista de discussão
\texttt{debian-stable-announce}
\hbr
\item \textbf{backports}: novas versões do original, baseadas na versão em
\textbf{testing}
\end{itemize}
\hbr
\item A suíte \textbf{stable} é atualizada a cada poucos meses por lançamentos
pontuais (\textsl{point releases}) que incluem apenas correções de bugs
\hhbr
\begin{itemize}
\item \small Pacotes cujo alvo é o próximo lançamento pontual são enviados para
\textbf{stable-proposed-updates} e revisados pelo time de lançamento
\end{itemize}
\hbr
\item A versão \textbf{oldstable} tem o mesmo conjunto de suítes
\end{itemize}
\end{frame}
\subsection{Várias maneiras de contribuir para Debian}
\begin{frame}{Várias maneiras de contribuir para Debian}
\begin{itemize}
\item \textbf{Pior} maneira de contribuir:
\begin{enumerate}
\item Empacotar a sua própria aplicação
\item Colocar ela no Debian
\item Desaparecer
\end{enumerate}
\br
\item \textbf{Melhores} maneiras de contribuir:
\begin{itemize}
\item Envolver-se com as equipes de empacotamento
\begin{itemize}
\item Muitas equipes focam em conjuntos de pacotes, e precisam de ajuda
\item Lista disponível em \url{https://wiki.debian.org/Teams}
\item Uma excelente maneira de aprender com contribuidores mais experientes
\end{itemize}
\br
\item Adotar pacotes existentes não mantidos (\textsl{pacotes órfãos})
\br
\item Trazer novo software para o Debian
\begin{itemize}
\item Apenas se for suficientemente interessante/útil, por favor
\item Existem alternativas já empacotadas no Debian?
\end{itemize}
\end{itemize}
\end{itemize}
\end{frame}
\subsection{Adotando pacotes órfãos}
\begin{frame}{Adotando pacotes órfãos}
\hbr
\begin{itemize}
\item Muitos pacotes não mantidos no Debian
\hbr
\item Lista completa + processo: \url{https://www.debian.org/devel/wnpp/}
\hbr
\item Instalados na sua máquina: \texttt{wnpp-alert}\\ Ou melhor:
\texttt{how-can-i-help}
\hbr
\item Estados diferentes:
\begin{itemize}
\small
\item \textbf{O}rphaned: o pacote não é mantido. Sinta-se livre para o adotar.
\hbr
\item \textbf{RFA}: \textbf{R}equest \textbf{F}or \textbf{A}dopter\\ O mantenedor
procura quem adote, mas continua a trabalhar enquanto isso\\ Sinta-se livre
para adotar. É cordial enviar um mail ao mantenedor atual.
\hbr
\item \textbf{ITA}: \textbf{I}ntent \textbf{T}o \textbf{A}dopt\\ Alguém tem a
intenção de adotar o pacote. Você pode oferecer ajuda!
\hbr
\item \textbf{RFH}: \textbf{R}equest \textbf{F}or \textbf{H}elp\\ O mantenedor
procura ajuda.
\end{itemize}
\hbr
\item Alguns pacotes não mantidos e não detectados \arr ainda não estão órfãos
\hbr
\item Quando em dúvidas, pergunte a \texttt{debian-qa@lists.debian.org} \\ ou
\texttt{\#debian-qa} em \texttt{irc.debian.org}
\end{itemize}
\end{frame}
\begin{frame}[fragile=singleslide]{Adoptando um pacote: exemplo}
\begin{lstlisting}[basicstyle=\ttfamily\footnotesize,escapeinside=\{\}]
From: You <you@yourdomain>
To: 640454@bugs.debian.org, control@bugs.debian.org
Cc: Francois Marier <francois@debian.org>
Subject: ITA: verbiste -- French conjugator
retitle 640454 ITA: verbiste -- French conjugator
owner 640454 !
thanks
Hi,
I am using verbiste and I am willing to take care of the package.
Cheers,
You
\end{lstlisting}
\begin{itemize}
\item Seja cortês ao contactar o mantenedor anterior (especialmente se o pacote
estava em RFA, não órfão)
\item É uma boa ideia contactar o projeto original
\end{itemize}
\end{frame}
\subsection{Colocando o seu pacote no Debian}
\begin{frame}{Colocando o seu pacote no Debian}
\begin{itemize}
\item Você não precisa de nenhum status oficial para ter o seu pacote no Debian
\begin{enumerate}
\item Submeta um bug \textbf{ITP} (\textbf{I}ntent \textbf{T}o \textbf{P}ackage)
usando \texttt{reportbug wnpp}
\hbr
\item Prepare um pacote fonte
\hbr
\item Encontre um Desenvolvedor Debian que apadrinhe o seu pacote (\emph{sponsor})
\end{enumerate}
\br
\item Status oficial (quando você é um mantenedor de pacotes experiente)
\begin{itemize}
\item \textbf{Mantenedor Debian (DM):}\\ Permissão para submeter os seus próprios
pacotes\\ Veja \url{https://wiki.debian.org/DebianMaintainer}
\hbr
\item \textbf{Desenvolvedor Debian (DD):}\\ Membro do projeto Debian; pode votar e
enviar (upload) qualquer pacote
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}{O que verificar antes de pedir apadrinhamento}
\begin{itemize}
\item Debian tem \textbf{muita atenção à qualidade}
\hbr
\item Geralmente, os \textbf{padrinhos são difíceis de encontrar e ocupados}
\begin{itemize}
\item Certifique-se de que seu pacote está pronto antes de pedir apadrinhamento
\end{itemize}
\hbr
\item Coisas a verificar:
\begin{itemize}
\item Evite a falta de dependências de compilação: certifique-se de que seu pacote
compila bem num \textsl{chroot} \textsl{sid} limpo
\begin{itemize}
\item É recomendado usar o \texttt{pbuilder}
\end{itemize}
\hbr
\item Rode \texttt{lintian -EviIL +pedantic} no seu pacote
\begin{itemize}
\item Os erros precisam ser corrigidos, todos os outros problemas devem ser
corrigidos
\end{itemize}
\hbr
\item E claro, faça testes abrangentes no seu pacote
\end{itemize}
\hbr
\item Em caso de dúvida, peça ajuda
\end{itemize}
\end{frame}
\subsection{Onde encontrar ajuda?}
\begin{frame}{Onde encontrar ajuda?}
\hbr
Ajuda que você vai precisar:
\begin{itemize}
\item Conselhos e respostas para as suas perguntas, revisões de código
\item Apadrinhamento para uploads, quando o pacote estiver pronto
\end{itemize}
\hbr
Você pode obter ajuda de:
\begin{itemize}
\item \textbf{Outros membros de uma equipe de empacotamento}
\begin{itemize}
\item Lista de equipes: \url{https://wiki.debian.org/Teams}
\end{itemize}
\hbr
\item O grupo \textbf{Debian Mentors} (se o pacote não se encaixar numa equipe)
\begin{itemize}
\item \url{https://wiki.debian.org/DebianMentorsFaq}
\item Lista de email: \url{debian-mentors@lists.debian.org}\\ {\small (também uma
boa maneira de aprender por acidente)}
\item IRC: \texttt{\#debian-mentors} em \texttt{irc.debian.org}
\item \url{http://mentors.debian.net/}
\item Documentação: \url{http://mentors.debian.net/intro-maintainers}
\end{itemize}
\hbr
\item \textbf{Listas de email localizadas} (obtenha ajuda no seu idioma)
\begin{itemize}
\item \texttt{debian-devel-\{french,italian,portuguese,spanish\}@lists.d.o}
\item Lista completa: \url{https://lists.debian.org/devel.html}
\item Ou listas de usuários: \url{https://lists.debian.org/users.html}
\end{itemize}
\end{itemize}
\end{frame}
\subsection{Mais documentação}
\begin{frame}{Mais documentação}
\begin{itemize}
\item O Canto dos Desenvolvedores Debian\\ \url{https://www.debian.org/devel/}\\
{\small Links para muitos recursos sobre o desenvolvimento do Debian}
\hbr
\item Guia para Mantenedores Debian\\
\url{https://www.debian.org/doc/manuals/debmake-doc/}
\hbr
\item Referência dos Desenvolvedores Debian\\
\url{https://www.debian.org/doc/developers-reference/}\\ {\small
Majoritariamente sobre procedimentos no Debian, mas também algumas melhores
práticas de empacotamento (parte 6)}
\hbr
\item Política Debian\\ \url{https://www.debian.org/doc/debian-policy/}\\
{\small \begin{itemize} \item \small Todos os requerimentos que cada pacote
deve satisfazer \item \small Políticas específicas para Perl, Java, Python,
\ldots \end{itemize}}
\hbr
\item Guia de Empacotamento Ubuntu\\
\url{https://packaging.ubuntu.com/html/}
\end{itemize}
\end{frame}
\subsection{\large Painéis de controle do Debian para mantenedores}
\begin{frame}{\large Painéis de controle do Debian para mantenedores}
\begin{itemize}
\item \textbf{Centrado no pacote fonte}:\\ \url{https://tracker.debian.org/dpkg}
\br
\item \textbf{Centrado no mantenedor/equipe}: Visão Geral de Pacotes do
Desenvolvedor (\textit{Developer's Packages Overview - DDPO})\\
\url{https://qa.debian.org/developer.php?login=pkg-ruby-extras-maintainers@lists.alioth.debian.org}
\br
\item \textbf{Orientado a lista A-FAZER}: Painel de Controle do Mantenedor Debian
(\textit{Debian Maintainer Dashboard - DMD})\\
\url{https://udd.debian.org/dmd/}
\end{itemize}
\end{frame}
\begin{frame}{Usando o Debian Bug Tracking System (BTS)}
\begin{itemize}
\item Uma maneira bem particular de gerenciar bugs
\begin{itemize}
\item Interface web para ver os bugs
\item Interface de email para fazer alterações nos bugs
\end{itemize}
\hbr
\item Adicionando informação aos bugs:
\begin{itemize}
\item Escreva para \texttt{123456@bugs.debian.org} (não inclui a pessoa que
submeteu, você precisa adicionar \texttt{123456-submitter@bugs.debian.org})
\end{itemize}
\hbr
\item Alterando o estado do bug:
\begin{itemize}
\item Envie comandos para \texttt{control@bugs.debian.org}
\item Interface de linha de comando: comando \texttt{bts} em \texttt{devscripts}
\item Documentação: \url{https://www.debian.org/Bugs/server-control}
\end{itemize}
\hbr
\item Reportando bugs: use \texttt{reportbug}
\begin{itemize}
\item Normalmente usado com um servidor de email local: instale \texttt{ssmtp} ou
\texttt{nullmailer}
\item Ou use \texttt{reportbug -\@-template}, depois envie (manualmente) para
\texttt{submit@bugs.debian.org}
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}{Usando o BTS: exemplos}
\begin{itemize}
\item Enviando um email para o bug e para quem o submeteu:\\
\url{https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=680822\#10}
\hbr
\item Etiquetando e alterando a severidade:\\
\url{https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=680227\#10}
\hbr
\item Re-atribuindo, alterando a severidade, mudando o título \ldots: \\
\url{https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=680822\#93}
\begin{itemize}
\item \texttt{notfound}, \texttt{found}, \texttt{notfixed}, \texttt{fixed} são
para \textbf{acompanhamento de versão} \\ Veja
\url{https://wiki.debian.org/HowtoUseBTS\#Version\_tracking}
\end{itemize}
\hbr
\item Usando etiquetas de usuário (\textit{usertags}):\\ \small
\url{https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=42;bug=642267} \\
Veja \url{https://wiki.debian.org/bugs.debian.org/usertags}
\hbr
\item Documentação do BTS:
\begin{itemize}
\item \url{https://www.debian.org/Bugs/}
\item \url{https://wiki.debian.org/HowtoUseBTS}
\end{itemize}
\end{itemize}
\end{frame}
\subsection{Mais interessado em Ubuntu?}
\begin{frame}{Mais interessado em Ubuntu?}
\begin{itemize}
\item Ubuntu gerencia, principalmente, a divergência com o Debian
\br
\item Nenhum foco real em pacotes específicos\\ Em vez disso, colaboração com as
equipes do Debian
\br
\item Normalmente é recomendado enviar novos pacote primeiro para o Debian\\
\url{https://wiki.ubuntu.com/UbuntuDevelopment/NewPackages}
\br
\item Possivelmente um plano melhor:
\begin{itemize}
\item Envolva-se numa equipe do Debian e atue como uma ponte com o Ubuntu
\hbr
\item Ajude a reduzir a divergência, triagem de bugs no Launchpad
\hbr
\item Muitas ferramentas do Debian podem ajudar:
\begin{itemize}
\item Coluna Ubuntu na visão geral de pacotes do desenvolvedor
\item Quadro do Ubuntu no Sistema de Acompanhamento de Pacotes (\textit{tracker})
\item Receba bugmail do launchpad via PTS
\end{itemize}
\end{itemize}
\end{itemize}
\end{frame}
\section{Conclusões}
\subsection{Conclusões}
\begin{frame}{Conclusões}
\begin{itemize}
\item Agora você tem uma visão geral do empacotamento Debian
\br
\item Mas você vai precisar ler mais documentação
\br
\item As melhores práticas evoluíram com os anos
\begin{itemize}
\item Em dúvida, use o ajudante de empacotamento \textbf{dh}, e o formato
\textbf{3.0 (quilt)}
\end{itemize}
\end{itemize}
\vfill
\centerline{\large Comentários: \textbf{packaging-tutorial@packages.debian.org}}
\end{frame}
\subsection{Questões legais}
\begin{frame}{Questões legais}
Copyright \copyright 2011--2019 Lucas Nussbaum -- lucas@debian.org
\br
{\small \textbf{Este documento é software livre}: você pode redistribuí-lo
e/ou modificá-lo sob (sua escolha): \hbr \begin{itemize} \item Os termos da
GNU General Public License como publicada pela Free Software Foundation, ou
versão 3 da licença, ou (sua escolha) qualquer versão mais recente.\\
\url{http://www.gnu.org/licenses/gpl.html} \br \item Os termos da Creative
Commons Attribution-ShareAlike 3.0 Unported License.\\
\url{http://creativecommons.org/licenses/by-sa/3.0/} \end{itemize} }
\end{frame}
\subsection{Contribua para este manual}
\begin{frame}{Contribua para este manual}
\begin{itemize}
\item Contribua:
\begin{itemize}
\item{\small \texttt{apt-get source packaging-tutorial}}
\hbr
\item {\small \texttt{debcheckout packaging-tutorial}}
\hbr
\item {\small \texttt{git clone\\
https://salsa.debian.org/debian/packaging-tutorial.git}}
\hbr
\item {\small \url{https://salsa.debian.org/debian/packaging-tutorial}}
\hbr
\item {\small Bugs abertos: \url{bugs.debian.org/src:packaging-tutorial}}
\end{itemize}
\br
\item Envie sugestões:
\begin{itemize}
\item \href{mailto:packaging-tutorial@packages.debian.org}{\textbf{\texttt{mailto:packaging-tutorial@packages.debian.org}}}
\begin{itemize}
\item{\small O que deve ser adicionado a este manual?}
\item {\small O que deve ser melhorado?}
\end{itemize}
\hbr
\item{\small \texttt{reportbug packaging-tutorial}}
\end{itemize}
\end{itemize}
\end{frame}
\section{Sessões práticas adicionais}
\subsection{Sessão prática 2: empacotando o GNUjump}
\begin{frame}{Sessão prática 2: empacotando o GNUjump}
\begin{enumerate}
\item Faça o download de GNUjump 1.0.8 de
\url{http://ftp.gnu.org/gnu/gnujump/gnujump-1.0.8.tar.gz}
\br
\item Crie um pacote Debian para ele
\begin{itemize}
\item Instale as dependências de compilação para poder compilar o pacote
\item Corrija bugs
\item Obtenha um pacote funcional básico
\item Termine de preencher \texttt{debian/control} e outros arquivos
\end{itemize}
\br
\item Aprecie
\end{enumerate}
\centerline{\includegraphics[width=5cm]{figs/gnujump.png}}
\end{frame}
\begin{frame}[fragile=singleslide]{\large Sessão prática 2: empacotando o GNUjump (dicas)}
\begin{itemize}
\item Para obter um pacote básico funcional, use \texttt{dh\_make}
\item No começo, criar um pacote fonte \textsl{1.0} é mais fácil do que um
\textsl{3.0 (quilt)} (mude isso em \texttt{debian/source/format})
\item Para descobrir dependências de compilação faltando, ao encontrar um arquivo
em falta, e use o \texttt{apt-file} para encontrar o pacote em falta.
\item Se você encontrar esse erro:
\begin{lstlisting}[basicstyle=\ttfamily\tiny]
/usr/bin/ld: SDL_rotozoom.o: undefined reference to symbol 'ceil@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:376: recipe for target 'gnujump' failed
\end{lstlisting}
Você precisa adicionar \texttt{-lm} à linha de comando do linker: Edite
\texttt{src/Makefile.am} e substitua
\begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
gnujump_LDFLAGS = $(all_libraries)
\end{lstlisting}
por
\begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
gnujump_LDFLAGS = -Wl,--as-needed
gnujump_LDADD = $(all_libraries) -lm
\end{lstlisting}
Depois rode \texttt{autoreconf -i}
\end{itemize}
\end{frame}
\subsection{\large Sessão prática 3: empacotar uma biblioteca Java}
\begin{frame}{\large Sessão prática 3: empacotar uma biblioteca Java}
\begin{enumerate}
\item Faça uma leitura rápida em alguma documentação sobre empacotamento Java:\\
\begin{itemize}
\item \url{https://wiki.debian.org/Java}
\hbr
\item \url{https://wiki.debian.org/Java/Packaging}
\hbr
\item \url{https://www.debian.org/doc/packaging-manuals/java-policy/}
\hbr
\item \texttt{/usr/share/doc/javahelper/tutorial.txt.gz}
\end{itemize}
\br
\item Baixe o IRClib de \url{http://moepii.sourceforge.net/}
\br
\item Empacote-o
\end{enumerate}
\end{frame}
\subsection{\large Sessão prática 4: empacotando um pacote Ruby}
\begin{frame}{\large Sessão prática 4: empacotando um pacote Ruby}
\begin{enumerate}
\item Dê uma lida rápida em alguma documentação sobre empacotamento Ruby:\\
\begin{itemize}
\item \url{https://wiki.debian.org/Ruby}
\hbr
\item \url{https://wiki.debian.org/Teams/Ruby}
\hbr
\item \url{https://wiki.debian.org/Teams/Ruby/Packaging}
\hbr
\item \texttt{gem2deb(1)}, \texttt{dh\_ruby(1)} (no pacote \texttt{gem2deb})
\end{itemize}
\hbr
\item Crie um pacote fonte Debian básico a partir do pacote ruby (\emph{gem})
\texttt{peach}:\\ \texttt{gem2deb peach}
\hbr
\item Melhore-o para que se torne um pacote Debian apropriado
\end{enumerate}
\end{frame}
\subsection{\large Sessão prática 5: empacotar um módulo Perl}
\begin{frame}[fragile=singleslide]{\large Sessão prática 5: empacotar um módulo Perl}
\begin{enumerate}
\item Faça uma leitura rápida em alguma documentação sobre empacotamento Perl:\\
\begin{itemize}
\item \url{https://perl-team.pages.debian.net}
\hbr
\item \url{https://wiki.debian.org/Teams/DebianPerlGroup}
\hbr
\item \texttt{dh-make-perl(1)}, \texttt{dpt(1)} (no pacote
\texttt{pkg-perl-tools})
\end{itemize}
\hbr
\item Crie um pacote fonte Debian básico a partir da distribuição CPAN
\texttt{Acme}:\\ \verb|dh-make-perl --cpan Acme|
\hbr
\item Melhore-o para que se torne um pacote Debian apropriado
\end{enumerate}
\end{frame}
\section{Respostas às sessões práticas}
\begin{frame}
\begin{center}
\LARGE Respostas às\\[0.5em] sessões práticas
\end{center}
\end{frame}
\subsection{Sessão prática 1: modificando o pacote grep}
\begin{frame}{Sessão prática 1: modificando o pacote grep}
\begin{enumerate}
\item Visite \url{http://ftp.debian.org/debian/pool/main/g/grep/} e baixe a versão
2.12-2 do pacote
\item Observe os arquivos em \texttt{debian/}
\begin{itemize}
\item Quantos pacotes binários são gerados por este pacote fonte?
\item Qual ajudante de empacotamento este pacote usa?
\end{itemize}
\hbr
\item Compile o pacote
\hbr
\item Agora vamos modificar o pacote. Adicione uma entrada no changelog e
incremente o número da versão.
\hbr
\item Agora desative o suporte a perl-regexp (uma opção do \texttt{./configure})
\hbr
\item Re-compile o pacote
\hbr
\item Compare os pacotes original e novo com o debdiff
\hbr
\item Instale o pacote que acaba de ser compilado
\end{enumerate}
\end{frame}
\begin{frame}{Obtendo o fonte}
\begin{enumerate}
\item Visite \url{http://ftp.debian.org/debian/pool/main/g/grep/} e baixe a versão
2.12-2 do pacote
\end{enumerate}
\begin{itemize}
\item Use dget para baixar o arquivo \texttt{.dsc}:\\ {\small \texttt{dget
http://cdn.debian.net/debian/pool/main/g/grep/grep\_2.12-2.dsc}}
\hbr
\item Se você tiver \texttt{deb-src} para uma versão do Debian que tem
\texttt{grep} versão 2.12-2 (descubra em
\url{https://tracker.debian.org/grep}), você pode usar \texttt{apt-get
source grep=2.12-2}\\ ou \texttt{apt-get source grep/versão}
(p.ex. \texttt{grep/stable})\\ ou, se tiver com sorte: \texttt{apt-get
source grep}
\hbr
\item O pacote fonte do \texttt{grep} é composto por três arquivos:
\begin{itemize}
\item \texttt{grep\_2.12-2.dsc}
\item \texttt{grep\_2.12-2.debian.tar.bz2}
\item \texttt{grep\_2.12.orig.tar.bz2}
\end{itemize}
Isto é típico do formato "3.0 (quilt)".
\hbr
\item Se necessário, descompacte o fonte com\\ \texttt{dpkg-source -x
grep\_2.12-2.dsc}
\end{itemize}
\end{frame}
\begin{frame}{Explorando e compilando o pacote}
\begin{enumerate}
\setcounter{enumi}{1}
\item Observe os arquivos em \texttt{debian/}
\begin{itemize}
\item Quantos pacotes binários são gerados por este pacote fonte?
\item Qual ajudante de empacotamento este pacote usa?
\end{itemize}
\end{enumerate}
\hbr
\begin{itemize}
\item De acordo com \texttt{debian/control}, este pacote gera apenas um pacote
binário, chamado \texttt{grep}.
\hbr
\item De acordo com \texttt{debian/rules}, este pacote é típico de empacotamento
debhelper \textsl{clássico}, sem usar \textsl{CDBS} ou \textsl{dh}. Pode-se
ver as várias chamadas a comandos \texttt{dh\_*} em \texttt{debian/rules}.
\end{itemize}
\hbr
\begin{enumerate}
\setcounter{enumi}{2}
\item Compile o pacote
\end{enumerate}
\hbr
\begin{itemize}
\item Use \texttt{apt-get build-dep grep} para obter as dependências de compilação
\item Depois \texttt{debuild} ou \texttt{dpkg-buildpackage -us -uc} (Demora cerca
de 1 minuto)
\end{itemize}
\end{frame}
\begin{frame}{Editando o registro de alterações (\emph{changelog})}
\begin{enumerate}
\setcounter{enumi}{3}
\item Agora vamos modificar o pacote. Adicione uma entrada no changelog e
incremente o número da versão.
\end{enumerate}
\hbr
\begin{itemize}
\item \texttt{debian/changelog} é um arquivo de texto. Você pode editá-lo e
adicionar uma nova entrada manualmente.
\hbr
\item Ou você pode usar \texttt{dch -i}, que irá adicionar uma entrada e abrir o
editor
\hbr
\item O nome e email podem ser definidos usando as variáveis de ambiente
\texttt{DEBFULLNAME} e \texttt{DEBEMAIL}
\hbr
\item Em seguida, recompile o pacote: uma nova versão do pacote é construída
\hbr
\item O versionamento de pacotes está detalhado na seção 5.6.12 da política
Debian\\ \url{https://www.debian.org/doc/debian-policy/ch-controlfields}
\end{itemize}
\end{frame}
\begin{frame}{\large Desativando suporte regexp de Perl e recompilando}
\begin{enumerate}
\setcounter{enumi}{4}
\item Agora desative o suporte a perl-regexp (uma opção do \texttt{./configure})
\item Re-compile o pacote
\end{enumerate}
\hbr
\begin{itemize}
\item Verifique com \texttt{./configure -{}-help}: a opção para desativar Perl
regexp é \texttt{-{}-disable-perl-regexp}
\hbr
\item Edite \texttt{debian/rules} e encontre a linha do \texttt{./configure}
\hbr
\item Adicione \texttt{-{}-disable-perl-regexp}
\hbr
\item Recompile com \texttt{debuild} ou \texttt{dpkg-buildpackage -us -uc}
\end{itemize}
\end{frame}
\begin{frame}{Comparando e testando os pacotes}
\begin{enumerate}
\setcounter{enumi}{6}
\item Compare os pacotes original e novo com o debdiff
\item Instale o pacote que acaba de ser compilado
\end{enumerate}
\hbr
\begin{itemize}
\item Compare os pacotes binários: \texttt{debdiff ../*changes}
\hbr
\item Compare os pacotes fonte: \texttt{debdiff ../*dsc}
\hbr
\item Instale o pacote recentemente compilado: \texttt{debi}\\ Ou \texttt{dpkg -i
../grep\_<TAB>}
\hbr
\item \texttt{grep -P foo} não funciona mais!
\end{itemize}
\br
Reinstale a versão anterior do pacote:
\begin{itemize}
\item \texttt{apt-get install -{}-reinstall grep=2.6.3-3} \textit{(= versão
anterior)}
\end{itemize}
\end{frame}
\subsection{Sessão prática 2: empacotando o GNUjump}
\begin{frame}{Sessão prática 2: empacotando o GNUjump}
\begin{enumerate}
\item Faça o download de GNUjump 1.0.8 de
\url{http://ftp.gnu.org/gnu/gnujump/gnujump-1.0.8.tar.gz}
\br
\item Crie um pacote Debian para ele
\begin{itemize}
\item Instale as dependências de compilação para poder compilar o pacote
\item Obtenha um pacote funcional básico
\item Termine de preencher \texttt{debian/control} e outros arquivos
\end{itemize}
\br
\item Aprecie
\end{enumerate}
\centerline{\includegraphics[width=5cm]{figs/gnujump.png}}
\end{frame}
\begin{frame}[fragile=singleslide]{Passo a passo\ldots}
\begin{itemize}
\item \texttt{wget http://ftp.gnu.org/gnu/gnujump/gnujump-1.0.8.tar.gz}
\hbr
\item \texttt{mv gnujump-1.0.8.tar.gz gnujump\_1.0.8.orig.tar.gz}
\hbr
\item \texttt{tar xf gnujump\_1.0.8.orig.tar.gz}
\hbr
\item \texttt{cd gnujump-1.0.8/}
\hbr
\item \texttt{dh\_make -f ../gnujump-1.0.8.tar.gz}
\begin{itemize}
\item \small Tipo de pacote: binário simples (por agora)
\end{itemize}
\end{itemize}
\begin{lstlisting}[basicstyle=\ttfamily\small]
gnujump-1.0.8$ ls debian/
changelog gnujump.default.ex preinst.ex
compat gnujump.doc-base.EX prerm.ex
control init.d.ex README.Debian
copyright manpage.1.ex README.source
docs manpage.sgml.ex rules
emacsen-install.ex manpage.xml.ex source
emacsen-remove.ex menu.ex watch.ex
emacsen-startup.ex postinst.ex
gnujump.cron.d.ex postrm.ex
\end{lstlisting}
\end{frame}
\begin{frame}[fragile=singleslide]{Passo a passo\ldots (2)}
\begin{itemize}
\item Observe \texttt{debian/changelog}, \texttt{debian/rules},
\texttt{debian/control}\\ (preenchido automaticamente por \textbf{dh\_make})
\hbr
\item Em \texttt{debian/control}:\\ \texttt{Build-Depends: debhelper (>= 7.0.50~),
autotools-dev}\\ Lista as \textsl{build-dependencies} = pacotes necessários
para compilar o pacote
\hbr
\item Tente compilar o pacote com \texttt{debuild} (graças à magia do \textbf{dh})
\begin{itemize}
\item E adicione as dependências de compilação, até que compile
\item Dica: use \texttt{apt-cache search} e \texttt{apt-file} para encontrar os
pacotes
\item Exemplo:
\begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
checking for sdl-config... no
checking for SDL - version >= 1.2.0... no
[...]
configure: error: *** SDL version 1.2.0 not found!
\end{lstlisting}
$\rightarrow$ Adicione \textbf{libsdl1.2-dev} a Build-Depends e instale-o.
\hbr
\item Melhor: use \textbf{pbuilder} para compilar num ambiente limpo
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}[fragile=singleslide]{Passo a passo\ldots (3)}
\begin{itemize}
\item As dependências de compilação necessárias são \texttt{libsdl1.2-dev,
libsdl-image1.2-dev, libsdl-mixer1.2-dev}
\item Então, você irá provavelmente ao encontro de outro erro:
\end{itemize}
\begin{lstlisting}[basicstyle=\ttfamily\tiny]
/usr/bin/ld: SDL_rotozoom.o: undefined reference to symbol 'ceil@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:376: recipe for target 'gnujump' failed
\end{lstlisting}
\begin{itemize}
\item Este problema é causado pelo bitrot: O gnujump não foi ajustado seguindo as
alterações do linker.
\item Se você estiver usando o formato de fonte versão \textbf{1.0} você pode
mudar diretamente as fontes do autor.
\begin{itemize}
\item Edite \texttt{src/Makefile.am} e substitua
\begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
gnujump_LDFLAGS = $(all_libraries)
\end{lstlisting}
por
\begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
gnujump_LDFLAGS = -Wl,--as-needed
gnujump_LDADD = $(all_libraries) -lm
\end{lstlisting}
\item Depois rode \texttt{autoreconf -i}
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}[fragile=singleslide]{Passo a passo\ldots (4)}
\begin{itemize}
\item Se estiver usando formato de fonte versão \textbf{3.0 (quilt)}, use
\texttt{quilt} para preparar um patch. (veja
\url{https://wiki.debian.org/UsingQuilt})
\begin{itemize}
\item \texttt{export QUILT\_PATCHES=debian/patches}
\item \texttt{mkdir debian/patches}\\ \texttt{quilt new linker-fixes.patch}\\
\texttt{quilt add src/Makefile.am}\\
\hbr
\item Edite \texttt{src/Makefile.am} e substitua
\begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
gnujump_LDFLAGS = $(all_libraries)
\end{lstlisting}
por
\begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
gnujump_LDFLAGS = -Wl,--as-needed
gnujump_LDADD = $(all_libraries) -lm
\end{lstlisting}
\hbr
\item \texttt{quilt refresh}
\hbr
\item Dado que o \texttt{src/Makefile.am} mudou, o autoreconf tem que ser chamado
durante a compilação. Para fazer isso automaticamente com \texttt{dh},
altere a chamada \texttt{dh} em \texttt{debian/rules} \\ de: \texttt{dh \$\@
-{}-with autotools-dev}\\ para: \texttt{dh \$\@ -{}-with autotools-dev
-{}-with autoreconf}
\hbr
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}[fragile=singleslide]{Passo a passo\ldots (5)}
\begin{itemize}
\item O pacote agora deve compilar sem problemas.
\hbr
\item Use \texttt{debc} para listar o conteúdo do pacote gerado, e \texttt{debi}
para o instalar e testar.
\hbr
\item Teste o pacote com \texttt{lintian}
\begin{itemize}
\item Embora não seja um requerimento estrito, é recomendado que os pacotes
enviados para o Debian sejam \textsl{lintian-clean} (passem no teste do
lintian)
\hbr
\item Mais problemas podem ser listados usando \texttt{lintian -EviIL +pedantic}
\hbr
\item Algumas dicas:
\begin{itemize}
\item Remova os arquivos que você não precisa em \texttt{debian/}
\hbr
\item Preencha \texttt{debian/control}
\hbr
\item Instale o executável em \texttt{/usr/games} passando por cima do
\texttt{dh\_auto\_configure}
\hbr
\item Use marcadores \textsl{hardening} do compilador para aumentar a segurança.\\
Veja \url{https://wiki.debian.org/Hardening}
\end{itemize}
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}{Passo a passo\ldots (6)}
\begin{itemize}
\item Compare o seu pacote com aquele já empacotado no Debian:
\begin{itemize}
\item Ele separa os arquivos de dados para um segundo pacote, que é o mesmo para
todas as arquiteturas ($\rightarrow$ poupa espaço no repositório Debian)
\hbr
\item Instala um arquivo .desktop (para os menus de GNOME/KDE) e também o integra
ao menu Debian
\hbr
\item Corrige alguns problemas menores usando patches
\end{itemize}
\end{itemize}
\end{frame}
\subsection{\large Sessão prática 3: empacotar uma biblioteca Java}
\begin{frame}{\large Sessão prática 3: empacotar uma biblioteca Java}
\begin{enumerate}
\item Faça uma leitura rápida em alguma documentação sobre empacotamento Java:\\
\begin{itemize}
\item \url{https://wiki.debian.org/Java}
\hbr
\item \url{https://wiki.debian.org/Java/Packaging}
\hbr
\item \url{https://www.debian.org/doc/packaging-manuals/java-policy/}
\hbr
\item \texttt{/usr/share/doc/javahelper/tutorial.txt.gz}
\end{itemize}
\br
\item Baixe o IRClib de \url{http://moepii.sourceforge.net/}
\br
\item Empacote-o
\end{enumerate}
\end{frame}
\begin{frame}{Passo a passo\ldots}
\begin{itemize}
\item \texttt{apt-get install javahelper}
\hbr
\item Crie um pacote fonte básico: \texttt{jh\_makepkg}
\begin{itemize}
\item Biblioteca
\item Nenhum
\item Compilador/runtime livre padrão
\end{itemize}
\hbr
\item Observe e corrija \texttt{debian/*}
\hbr
\item \texttt{dpkg-buildpackage -us -uc} ou \texttt{debuild}
\hbr
\item \texttt{lintian}, \texttt{debc}, etc.
\hbr
\item Compare o seu resultado com o pacote fonte \texttt{libirclib-java}
\end{itemize}
\end{frame}
\subsection{\large Sessão prática 4: empacotando um pacote Ruby}
\begin{frame}{\large Sessão prática 4: empacotando um pacote Ruby}
\begin{enumerate}
\item Dê uma lida rápida em alguma documentação sobre empacotamento Ruby:\\
\begin{itemize}
\item \url{https://wiki.debian.org/Ruby}
\hbr
\item \url{https://wiki.debian.org/Teams/Ruby}
\hbr
\item \url{https://wiki.debian.org/Teams/Ruby/Packaging}
\hbr
\item \texttt{gem2deb(1)}, \texttt{dh\_ruby(1)} (no pacote \texttt{gem2deb})
\end{itemize}
\hbr
\item Crie um pacote fonte Debian básico a partir do pacote ruby (\emph{gem})
\texttt{peach}:\\ \texttt{gem2deb peach}
\hbr
\item Melhore-o para que se torne um pacote Debian apropriado
\end{enumerate}
\end{frame}
\begin{frame}{Passo a passo\ldots}
\texttt{gem2deb peach}:
\begin{itemize}
\item Baixa o pacote (\emph{gem}) de rubygems.org
\item Cria um arquivo .orig.tar.gz apropriado e descompacta-o
\item Inicializa um pacote fonte Debian baseado nos meta-dados do gem
\begin{itemize}
\item Chamado \texttt{ruby-\textsl{gemname}}
\end{itemize}
\item Tenta compilar o pacote binário Debian (pode falhar)
\end{itemize}
\br
\texttt{dh\_ruby} (incluído em \textsl{gem2deb}) faz as tarefas específicas
de Ruby:
\begin{itemize}
\item Compila extensões de C para cada versão de Ruby
\item Copia os arquivos para o seu diretório de destino
\item Atualiza \textit{shebangs} nos scripts executáveis
\item Roda os testes definidos em \texttt{debian/ruby-tests.rb},
\texttt{debian/ruby-tests.rake}, ou \texttt{debian/ruby-test-files.yaml},
assim como várias outras verificações
\end{itemize}
\end{frame}
\begin{frame}[fragile=singleslide]{Passo a passo\ldots (2)}
Melhore o pacote gerado
\begin{itemize}
\item Rode \texttt{debclean} para limpar a árvore fonte. Observe \texttt{debian/}
\hbr
\item \texttt{changelog} e \texttt{compat} devem estar corretos
\hbr
\item Edite \texttt{debian/control}: melhore o campo \texttt{Description}
\hbr
\item Escreva um arquivo \texttt{copyright} apropriado com base nos arquivos do
autor
\hbr
\item Compile o pacote
\hbr
\item Compare o seu pacote com o pacote \texttt{ruby-peach} no repositório Debian
\end{itemize}
\end{frame}
\subsection{\large Sessão prática 5: empacotar um módulo Perl}
\begin{frame}[fragile=singleslide]{\large Sessão prática 5: empacotar um módulo Perl}
\begin{enumerate}
\item Faça uma leitura rápida em alguma documentação sobre empacotamento Perl:\\
\begin{itemize}
\item \url{https://perl-team.pages.debian.net}
\hbr
\item \url{https://wiki.debian.org/Teams/DebianPerlGroup}
\hbr
\item \texttt{dh-make-perl(1)}, \texttt{dpt(1)} (no pacote
\texttt{pkg-perl-tools})
\end{itemize}
\hbr
\item Crie um pacote fonte Debian básico a partir da distribuição CPAN
\texttt{Acme}:\\ \verb|dh-make-perl --cpan Acme|
\hbr
\item Melhore-o para que se torne um pacote Debian apropriado
\end{enumerate}
\end{frame}
\begin{frame}[fragile=singleslide]{Passo a passo\ldots}
\verb|dh-make-perl --cpan Acme|:
\begin{itemize}
\item Baixa o tarball a partir de CPAN
\item Cria um arquivo .orig.tar.gz apropriado e descompacta-o
\item Inicializa um pacote fonte Debian baseado nos meta-dados da distribuição
\begin{itemize}
\item Chamado \texttt{lib\textsl{distname}-perl}
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}[fragile=singleslide]{Passo a passo\ldots (2)}
Melhore o pacote gerado
\begin{itemize}
\item \texttt{debian/changelog}, \texttt{debian/compat},
\texttt{debian/libacme-perl.docs}, e \texttt{debian/watch} devem estar
corretos
\hbr
\item Edite \texttt{debian/control}: melhore o campo \texttt{Description}, e
remova o texto padrão no final
\hbr
\item Edite \texttt{debian/copyright}: remova o parágrafo de texto padrão no topo,
adicione anos de copyright à estrofe de \texttt{Files:\hspace{0.3em}*}
\end{itemize}
\end{frame}
\section*{Tradução}
\begin{frame}{Tradução}
Este tutorial foi traduzido por Tássia Camões Araújo e Leandro Luiz Pereira,
usando a tradução de Américo Monteiro (português de Portugal) como ponto de
partida.
\hbr
Se você encontrar algum erro na tradução deste documento, por favor entre em
contato com \href{mailto:tassia@debian.org}{\texttt{<tassia@debian.org>}},
\href{mailto:leandro@fullonmorning.com}{\texttt{<leandro@fullonmorning.com>}}
ou
\href{mailto:debian-l10n-portuguese@lists.debian.org}{\texttt{<debian-l10n-portuguese@lists.debian.org>}}.
\end{frame}
\end{document}
|